https://kotlinlang.org logo
#compose
Title
# compose
n

Nizam

03/09/2024, 12:28 PM
I have this below composable. when I scroll the lazycolumn, the bottomsheet closes. how to fix this? Please help since we are stuck with this for a week now. https://stackoverflow.com/questions/78132339/lazycolumn-inside-modalbottomsheetlayout-scroll-issue
val 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*")
}
}
}
🧵 4
z

Zach Klippenstein (he/him) [MOD]

03/10/2024, 10:46 PM
Please keep long code snippets to the thread to keep the main channel more readable, thanks
2 Views