Dovydas
03/04/2025, 8:59 PMUIKitViewController
with frequently changing animation state, but it seems to never rebuild. See thread.Dovydas
03/04/2025, 9:00 PM@Composable
actual fun NativeAppTopBar(
modifier: Modifier,
pagerState: PagerState
) {
val coroutineScope = rememberCoroutineScope()
val factory = LocalNativeViewFactory.current
val appTabs = AppTabs.entries.map { it.label.asString() }
UIKitViewController(
modifier = modifier.statusBarsPadding(),
factory = {
println("rebuilt")
factory.createAppTopBarView(
currentOffsetForPage = { pagerState.calculateCurrentOffsetForPage(it) },
onClick = { coroutineScope.launch { pagerState.animateScrollToPage(it) } },
appTabs = appTabs
)
}
)
}
PagerState current offset changes very frequently, yet the View never rebuilds after the initial build.