Apply Handle + shape to all bottomsheet
This commit is contained in:
parent
7cc08cf300
commit
1f0c6de78d
6 changed files with 22 additions and 8 deletions
|
@ -104,7 +104,7 @@ fun FilterBottomSheet(
|
|||
skipHalfExpanded = true,
|
||||
),
|
||||
sheetState: FilterBottomSheetState = rememberFilterBottomSheetState(),
|
||||
sheetShape: Shape = MaterialTheme.bibLib.shapes.filterSheet,
|
||||
sheetShape: Shape = MaterialTheme.bibLib.shapes.sheet,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
CompositionLocalProvider(
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
package com.pixelized.biblib.ui.composable.scaffold
|
||||
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.material.ExperimentalMaterialApi
|
||||
import androidx.compose.material.ModalBottomSheetLayout
|
||||
import androidx.compose.material.ModalBottomSheetState
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.ModalBottomSheetValue.Hidden
|
||||
import androidx.compose.material.rememberModalBottomSheetState
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
import com.pixelized.biblib.model.search.SortType
|
||||
import com.pixelized.biblib.model.search.SortValue
|
||||
import com.pixelized.biblib.ui.screen.home.sort.BookSortPage
|
||||
import com.pixelized.biblib.utils.extention.bibLib
|
||||
import kotlinx.coroutines.CancellableContinuation
|
||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
|
@ -82,6 +81,7 @@ fun SortBottomSheet(
|
|||
initialValue = Hidden,
|
||||
skipHalfExpanded = true,
|
||||
),
|
||||
sheetShape: Shape = MaterialTheme.bibLib.shapes.sheet,
|
||||
sheetState: SortBottomSheetState = rememberSortBottomSheetState(),
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
|
@ -98,7 +98,7 @@ fun SortBottomSheet(
|
|||
)
|
||||
// Check the state of the bottomSheetState and call for dismiss if needed.
|
||||
HandleBottomSheetDismiss(
|
||||
bottomSheetState =bottomSheetState,
|
||||
bottomSheetState = bottomSheetState,
|
||||
onDismiss = { currentBottomSheetData?.dismiss() }
|
||||
)
|
||||
// Handle back event.
|
||||
|
@ -110,6 +110,7 @@ fun SortBottomSheet(
|
|||
ModalBottomSheetLayout(
|
||||
sheetState = bottomSheetState,
|
||||
content = content,
|
||||
sheetShape = sheetShape,
|
||||
scrimColor = Color.Transparent,
|
||||
sheetContent = {
|
||||
BookSortPage(
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.pixelized.biblib.ui.composable.scaffold.LocalDetailBottomSheetState
|
|||
import com.pixelized.biblib.ui.screen.home.profile.ProfileViewModel
|
||||
import com.pixelized.biblib.ui.screen.home.profile.UserUio
|
||||
import com.pixelized.biblib.ui.theme.color.ShadowPalette
|
||||
import com.pixelized.biblib.utils.extention.bibLib
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
@Stable
|
||||
|
@ -73,6 +74,7 @@ fun DetailScreen(
|
|||
ModalBottomSheetLayout(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
sheetState = emailSheetState,
|
||||
sheetShape = MaterialTheme.bibLib.shapes.sheet,
|
||||
scrimColor = ShadowPalette.scrim,
|
||||
sheetContent = {
|
||||
DetailScreenSendOption(
|
||||
|
|
|
@ -15,6 +15,7 @@ import androidx.compose.material.RadioButton
|
|||
import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.AnnotatedString
|
||||
|
@ -25,6 +26,7 @@ import androidx.compose.ui.tooling.preview.Preview
|
|||
import androidx.compose.ui.unit.dp
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
import com.pixelized.biblib.R
|
||||
import com.pixelized.biblib.ui.composable.Handle
|
||||
import com.pixelized.biblib.ui.theme.BibLibTheme
|
||||
import com.pixelized.biblib.utils.extention.*
|
||||
|
||||
|
@ -87,6 +89,11 @@ fun DetailScreenSendOption(
|
|||
.padding(top = 16.dp)
|
||||
.padding(horizontal = 16.dp),
|
||||
) {
|
||||
Handle(
|
||||
modifier = Modifier
|
||||
.align(alignment = CenterHorizontally)
|
||||
.padding(bottom = 16.dp),
|
||||
)
|
||||
Text(
|
||||
modifier = Modifier.padding(bottom = 16.dp),
|
||||
style = MaterialTheme.typography.h6,
|
||||
|
@ -95,7 +102,6 @@ fun DetailScreenSendOption(
|
|||
)
|
||||
|
||||
Text(
|
||||
modifier = Modifier.padding(bottom = 8.dp),
|
||||
style = MaterialTheme.typography.caption,
|
||||
color = MaterialTheme.bibLib.colors.typography.light,
|
||||
text = rememberDescription()
|
||||
|
|
|
@ -26,6 +26,7 @@ import androidx.hilt.navigation.compose.hiltViewModel
|
|||
import com.pixelized.biblib.R
|
||||
import com.pixelized.biblib.model.search.SortType
|
||||
import com.pixelized.biblib.model.search.SortValue
|
||||
import com.pixelized.biblib.ui.composable.Handle
|
||||
import com.pixelized.biblib.ui.theme.BibLibTheme
|
||||
import com.pixelized.biblib.utils.extention.bibLib
|
||||
import org.burnoutcrew.reorderable.*
|
||||
|
@ -73,6 +74,10 @@ private fun BookSortPageContent(
|
|||
modifier = modifier,
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
) {
|
||||
Handle(
|
||||
modifier = Modifier.align(Alignment.CenterHorizontally),
|
||||
)
|
||||
|
||||
Text(
|
||||
modifier = Modifier.padding(horizontal = 16.dp),
|
||||
style = MaterialTheme.typography.h6,
|
||||
|
|
|
@ -17,5 +17,5 @@ data class BibLibShape(
|
|||
),
|
||||
val bookThumbnailCoverSmall: Shape = RoundedCornerShape(4.dp),
|
||||
val bookThumbnailCoverLarge: Shape = RoundedCornerShape(4.dp),
|
||||
val filterSheet: Shape = RoundedCornerShape(topEnd = 16.dp, topStart = 16.dp),
|
||||
val sheet: Shape = RoundedCornerShape(topEnd = 16.dp, topStart = 16.dp),
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue