Untitled

mail@pastecode.io avatar
unknown
kotlin
a year ago
2.0 kB
1
Indexable
Never
BottomDrawer(
        drawerState = drawerState,
        scrimColor = colors.background.copy(0.9f),
        drawerBackgroundColor = colors.secondary,
        drawerShape = RoundedCornerShape(topStart = 30.dp, topEnd = 30.dp),
        gesturesEnabled = drawerState.isOpen,
        drawerElevation = 0.dp,
        drawerContent = {
            BottomDrawerMoreOptions(
                checklistViewModel = checklistViewModel,
                share = { context.startActivity(checklistViewModel.shareChecklist()) },
                confirmDelete = {
                    checklistViewModel.confirmDeleteAllChecked()
                    coroutineScope.launch { drawerState.animateTo(BottomDrawerValue.Closed) }
                },
                reArrange = {
                    checklistViewModel.reArrange(!checklistUiState.reArrange)
                    coroutineScope.launch { drawerState.animateTo(BottomDrawerValue.Closed) }
                },
                unCheckCompleted = {
                    checklistViewModel.unCheckCompleted()
                    coroutineScope.launch { drawerState.animateTo(BottomDrawerValue.Closed) }
                }
            )
        }
    ){
        Scaffold(
            modifier = Modifier.fillMaxWidth(),
            topBar = {
                TopNavigationChecklist(
                    backButton = {
                        focusManager.clearFocus()
                        checklistViewModel.returnAndSaveChecklist(navController)
                    },
                    moreOptions = {
                        coroutineScope.launch{
                            drawerState.animateTo(BottomDrawerValue.Expanded)
                            checklistViewModel.pullUp(true)
                        }
                    },
                    header = checklistUiState.header,
                    showHeader = showButton,
                    share = { context.startActivity(checklistViewModel.shareChecklist()) }
                )
            },
        ) { padding ->
            Content()
        }