Skip to content

Commit

Permalink
[FEAT/#24] basic bottom sheet dragHandle 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyobeen-Park committed Jan 16, 2025
1 parent 2ef7de6 commit 5714269
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fun FixedBottomSheet(
private fun FixedBottomSheetPreview() {
SpoonyAndroidTheme {
FixedBottomSheet(
sheetContent = {},
sheetContent = {}
) { }
}
}
Original file line number Diff line number Diff line change
@@ -1,58 +1,32 @@
package com.spoony.spoony.core.designsystem.component.bottomsheet

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.BottomSheetDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.spoony.spoony.core.designsystem.theme.SpoonyAndroidTheme

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SpoonyBasicBottomSheet(
content: @Composable () -> Unit,
onDismiss: () -> Unit,
modifier: Modifier = Modifier,
sheetState: SheetState = rememberModalBottomSheetState(),
isBackgroundDimmed: Boolean = true,
dragHandle: @Composable () -> Unit = {},
content: @Composable () -> Unit
) {
ModalBottomSheet(
onDismissRequest = onDismiss,
modifier = modifier,
sheetState = sheetState,
containerColor = SpoonyAndroidTheme.colors.white,
scrimColor = if (isBackgroundDimmed) BottomSheetDefaults.ScrimColor else Color.Transparent,
dragHandle = {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier
.padding(vertical = 22.dp)
.fillMaxWidth()
) {
Box(
modifier = Modifier
.size(
width = 24.dp,
height = Dp.Hairline.plus(2.dp)
)
.background(SpoonyAndroidTheme.colors.gray300),
)
dragHandle()
}
}
dragHandle = dragHandle
) {
content()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fun SpoonyFlexibleBottomSheet(
modifier: Modifier = Modifier,
minHeight: Dp = 50.dp,
dragHandle: @Composable () -> Unit = {},
content: @Composable () -> Unit,
content: @Composable () -> Unit
) {
val configuration = LocalConfiguration.current
val screenHeight = configuration.screenHeightDp.dp
Expand Down

0 comments on commit 5714269

Please sign in to comment.