Archie
08/02/2020, 4:19 PMViewPager
onboarding screen. But the Button
(which in this case is "Get Started") isn't part of the Scrolling
and remains on its place regardless of item.
In the xml world we added a padding to the ViewPager
so the Contents would never have a chance to overlap with the Button
. We did something like this in code:
view.doOnPreDraw {
binding.viewPager.updatePadding(bottom = <http://binding.getStartedButton.top|binding.getStartedButton.top>)
}
I need to do the same in Compose
. Is there a way to reference to the Position
of the Button
so I could do somthing like:
Stack {
WithConstraints {
ScrollableRow(
modifier = Modifier.padding(bottom = <http://Button.top|Button.top>) // Something like this...
) {
OnboardingItem(
...
)
...
}
}
Button(
modifier = Modifier.gravity(Alignment.BottomCenter),
onClick = {}
) {
Text(text = "Get Started")
}
}