Albert Francis
10/21/2021, 11:32 AMHorizontalPager
with x many
items (can be 1 can be 20+) and each one of the item needs to call a BackEnd to fill it's information.
So every time i receive a pageIndex i call viewmodel.getMeSomeCake(index)
and when i receive it i want to fill the screen.
I want to use StateFlow but i got the same problem as if it's a fragment with ViewPager. Pager creates the n-1
,n
,n+1
pages so the data i got is not the one for the visible page.
is there any recommended ways to do it on compose?Colton Idle
10/21/2021, 4:04 PMAlbert Francis
10/21/2021, 6:29 PMColton Idle
10/21/2021, 9:32 PMAlbert Francis
10/22/2021, 8:01 AMkey
that i know will give me the data for the visible page.
I am hoping to use viewmodel and stateflow/sharedflow something to get the data and not call the BackEnd directly from compose and get the result to compose.