fix: Pad 启动闪退
This commit is contained in:
parent
397c1d914c
commit
a7f88a8fe2
|
|
@ -243,40 +243,40 @@ fun MainPage(
|
||||||
GlobalEvent.Refresh(navigationItems[it].id)
|
GlobalEvent.Refresh(navigationItems[it].id)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
NavigationWrapper(
|
ProvideNavigator(navigator = navigator) {
|
||||||
currentPosition = pagerState.currentPage,
|
NavigationWrapper(
|
||||||
onChangePosition = { coroutineScope.launch { pagerState.scrollToPage(it) } },
|
currentPosition = pagerState.currentPage,
|
||||||
onReselected = onReselected,
|
onChangePosition = { coroutineScope.launch { pagerState.scrollToPage(it) } },
|
||||||
navigationItems = navigationItems,
|
onReselected = onReselected,
|
||||||
navigationType = navigationType,
|
navigationItems = navigationItems,
|
||||||
navigationContentPosition = navigationContentPosition
|
navigationType = navigationType,
|
||||||
) {
|
navigationContentPosition = navigationContentPosition
|
||||||
MyScaffold(
|
) {
|
||||||
backgroundColor = Color.Transparent,
|
MyScaffold(
|
||||||
modifier = Modifier.fillMaxSize(),
|
backgroundColor = Color.Transparent,
|
||||||
bottomBar = {
|
|
||||||
AnimatedVisibility(visible = navigationType == MainNavigationType.BOTTOM_NAVIGATION) {
|
|
||||||
BottomNavigation(
|
|
||||||
currentPosition = pagerState.currentPage,
|
|
||||||
onChangePosition = {
|
|
||||||
coroutineScope.launch { pagerState.scrollToPage(it) }
|
|
||||||
},
|
|
||||||
onReselected = onReselected,
|
|
||||||
navigationItems = navigationItems,
|
|
||||||
themeColors = themeColors,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) { paddingValues ->
|
|
||||||
LazyLoadHorizontalPager(
|
|
||||||
contentPadding = paddingValues,
|
|
||||||
state = pagerState,
|
|
||||||
key = { navigationItems[it].id },
|
|
||||||
modifier = Modifier.fillMaxSize(),
|
modifier = Modifier.fillMaxSize(),
|
||||||
verticalAlignment = Alignment.Top,
|
bottomBar = {
|
||||||
userScrollEnabled = false
|
AnimatedVisibility(visible = navigationType == MainNavigationType.BOTTOM_NAVIGATION) {
|
||||||
) {
|
BottomNavigation(
|
||||||
ProvideNavigator(navigator = navigator) {
|
currentPosition = pagerState.currentPage,
|
||||||
|
onChangePosition = {
|
||||||
|
coroutineScope.launch { pagerState.scrollToPage(it) }
|
||||||
|
},
|
||||||
|
onReselected = onReselected,
|
||||||
|
navigationItems = navigationItems,
|
||||||
|
themeColors = themeColors,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) { paddingValues ->
|
||||||
|
LazyLoadHorizontalPager(
|
||||||
|
contentPadding = paddingValues,
|
||||||
|
state = pagerState,
|
||||||
|
key = { navigationItems[it].id },
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
verticalAlignment = Alignment.Top,
|
||||||
|
userScrollEnabled = false
|
||||||
|
) {
|
||||||
navigationItems[it].content()
|
navigationItems[it].content()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue