Michael Marshall
10/27/2021, 5:22 AMHorizontalPager
and I’ve noticed that doing something like,
val scope = rememberCoroutineScope()
val pagerState = rememberPagerState()
...
Tab (
...
onClick = { scope.launch { pagerState.animateScrollToPage(index) } }
...
)
feels like a bit of an imperative programming anti-pattern compared to declaratively creating an AnimatedContent
as described in the docs.
I assume it’s doing something similar under the hood anyway, and this is just a convenience function, so it’s ok?Csaba Kozák
10/27/2021, 7:58 AM