I have a screen which pretty much look like the im...
# compose
a
I have a screen which pretty much look like the image attached. Its a
ViewPager
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:
Copy 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:
Copy code
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")
    }
}