I have a vertical VerticalPager with 2 pages.
I would like to make a background (for my case it is a gradient which begin on top of page 1 and finish at the bottom of page 2.
It is possible in Android Compose ?
Thank you.
I have a vertical VerticalPager with 2 pages.
I would like to make a background (for my case it is a gradient which begin on top of page 1 and finish at the bottom of page 2.
It is possible in Android Compose ?
Thank you.
Copyright © 2021 Jogjafile Inc.
Absolutely, it's possible to achieve a vertical gradient background spanning multiple pages in Jetpack Compose. Here's how you can do it:
We'll create a custom modifier that applies the gradient background based on the vertical pager's scroll position.
This approach creates a dynamic background that adjusts the gradient position based on the vertical scroll of the pager. The gradient starts at the top on the first page and transitions to the end color as you scroll down to the second page.