Nizam
03/09/2024, 12:28 PMval navController = rememberNavController()
val sheetState = rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue._Hidden_,
skipHalfExpanded = true,
confirmValueChange = *{* it ->
Log.d("HomePageActivity", "SheetStateInside is $it")
false
*}*,
)
val bottomSheetNavigator = remember *{* BottomSheetNavigator(sheetState) *}*
navController.navigatorProvider += bottomSheetNavigator
AppTheme *{*
ModalBottomSheetLayout(
bottomSheetNavigator = bottomSheetNavigator,
sheetShape = _RoundedCornerShape_(topStart = 16._dp_, topEnd = 16._dp_),
sheetBackgroundColor = _neutral5_,
) *{*
DestinationsNavHost(
navController = navController,
navGraph = NavGraphs.root,
startRoute = AppChooserBottomSheetDestination,
engine = rememberAnimatedNavHostEngine(),
)
AppChooserBottomSheet.kt
@Destination(style = DestinationStyleBottomSheet::class)
// @Destination
@Composable
fun AppChooserBottomSheet(
navigator: DestinationsNavigator,
) {
LazyColumn *{*
_repeat_(100) *{*
item *{*
Text(text = "App $*it*", style = MaterialTheme.typography.titleLarge, color = _neutral100_, modifier = Modifier._fillMaxWidth_()._padding_(vertical = 8._dp_))
Log.d("HomePageActivity", "SheetStateAppChooser visible is $*it*")
}
}
}
Zach Klippenstein (he/him) [MOD]
03/10/2024, 10:46 PM