DocumentScreen: make the list automatically scroll to the selected page
This commit is contained in:
@@ -89,6 +89,11 @@ fun DocumentScreen(
|
|||||||
}
|
}
|
||||||
BackHandler { navigation.back() }
|
BackHandler { navigation.back() }
|
||||||
|
|
||||||
|
val listState = rememberLazyListState()
|
||||||
|
LaunchedEffect(currentPageIndex.intValue) {
|
||||||
|
listState.animateScrollToItem(currentPageIndex.intValue)
|
||||||
|
}
|
||||||
|
|
||||||
MyScaffold(
|
MyScaffold(
|
||||||
toAboutScreen = navigation.toAboutScreen,
|
toAboutScreen = navigation.toAboutScreen,
|
||||||
pageListState = CommonPageListState(
|
pageListState = CommonPageListState(
|
||||||
@@ -96,7 +101,7 @@ fun DocumentScreen(
|
|||||||
imageLoader,
|
imageLoader,
|
||||||
onPageClick = { index -> currentPageIndex.intValue = index },
|
onPageClick = { index -> currentPageIndex.intValue = index },
|
||||||
currentPageIndex = currentPageIndex.intValue,
|
currentPageIndex = currentPageIndex.intValue,
|
||||||
listState = rememberLazyListState(),
|
listState = listState,
|
||||||
),
|
),
|
||||||
onBack = navigation.back,
|
onBack = navigation.back,
|
||||||
bottomBar = {
|
bottomBar = {
|
||||||
|
|||||||
Reference in New Issue
Block a user