Deepak Gahlot
03/08/2021, 4:24 PMDeepak Gahlot
03/08/2021, 4:24 PMDeepak Gahlot
03/08/2021, 4:25 PM@ExperimentalMaterialApi
@Composable
private fun QuestionnaireTopBar(
questionIndex: Int,
totalQuestionsCount: Int
) {
val bottomSheetScaffoldState = rememberBottomSheetScaffoldState(
bottomSheetState = BottomSheetState(BottomSheetValue.Collapsed)
)
Column() {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
TopAppBarTitle(
modifier = Modifier
.padding(start = 20.dp)
)
Row() {
BottomSheet(bottomSheetScaffoldState = bottomSheetScaffoldState)
IconButton(
onClick = { },
) {
Icon(
painterResource(id = R.drawable.ico_expand),
contentDescription = "expand"
)
}
}
}
}
}
@ExperimentalMaterialApi
@Composable
fun BottomSheet(bottomSheetScaffoldState: BottomSheetScaffoldState) {
val coroutineScope = rememberCoroutineScope()
BottomSheetScaffold(
scaffoldState = bottomSheetScaffoldState,
sheetContent = {
},
sheetPeekHeight = 0.dp
) {
IconButton(
onClick = {
coroutineScope.launch {
if (bottomSheetScaffoldState.bottomSheetState.isCollapsed) {
bottomSheetScaffoldState.bottomSheetState.expand()
} else {
bottomSheetScaffoldState.bottomSheetState.collapse()
}
}
},
) {
Icon(
painterResource(id = R.drawable.ic_list),
contentDescription = "list"
)
}
}
}
Deepak Gahlot
03/08/2021, 4:25 PMDeepak Gahlot
03/08/2021, 4:27 PM