Skip to content

Commit 06ab78c

Browse files
committed
[NDGL-86] design: NDGLBottomSheet 수정
1 parent 9a0b25c commit 06ab78c

3 files changed

Lines changed: 39 additions & 44 deletions

File tree

core/ui/src/main/java/com/yapp/ndgl/core/ui/designsystem/NDGLBottomSheet.kt

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
package com.yapp.ndgl.core.ui.designsystem
22

3+
import androidx.compose.foundation.clickable
34
import androidx.compose.foundation.layout.Column
45
import androidx.compose.foundation.layout.ColumnScope
6+
import androidx.compose.foundation.layout.Row
7+
import androidx.compose.foundation.layout.Spacer
58
import androidx.compose.foundation.layout.fillMaxWidth
69
import androidx.compose.foundation.layout.padding
10+
import androidx.compose.foundation.layout.size
11+
import androidx.compose.foundation.shape.CircleShape
712
import androidx.compose.foundation.shape.RoundedCornerShape
813
import androidx.compose.material3.BottomSheetDefaults
914
import androidx.compose.material3.ExperimentalMaterial3Api
15+
import androidx.compose.material3.Icon
1016
import androidx.compose.material3.ModalBottomSheet
1117
import androidx.compose.material3.Text
1218
import androidx.compose.material3.rememberModalBottomSheetState
1319
import androidx.compose.runtime.Composable
1420
import androidx.compose.ui.Modifier
21+
import androidx.compose.ui.draw.clip
22+
import androidx.compose.ui.graphics.vector.ImageVector
23+
import androidx.compose.ui.res.vectorResource
1524
import androidx.compose.ui.tooling.preview.Preview
1625
import androidx.compose.ui.unit.dp
26+
import com.yapp.ndgl.core.ui.R
1727
import com.yapp.ndgl.core.ui.theme.NDGLTheme
1828

1929
@OptIn(ExperimentalMaterial3Api::class)
@@ -22,6 +32,7 @@ fun NDGLBottomSheet(
2232
modifier: Modifier = Modifier,
2333
onDismissRequest: () -> Unit,
2434
showDragHandle: Boolean = true,
35+
title: String? = null,
2536
content: @Composable ColumnScope.() -> Unit,
2637
) {
2738
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
@@ -37,8 +48,31 @@ fun NDGLBottomSheet(
3748
},
3849
containerColor = NDGLTheme.colors.white,
3950
shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
40-
content = content,
41-
)
51+
) {
52+
title?.let { title ->
53+
Row(
54+
modifier = Modifier
55+
.fillMaxWidth()
56+
.padding(vertical = 18.dp, horizontal = 24.dp),
57+
) {
58+
Text(title, color = NDGLTheme.colors.black400, style = NDGLTheme.typography.bodyLgMedium)
59+
Spacer(Modifier.weight(1f))
60+
Icon(
61+
imageVector = ImageVector.vectorResource(R.drawable.ic_24_close),
62+
contentDescription = null,
63+
tint = NDGLTheme.colors.black600,
64+
modifier = Modifier
65+
.size(24.dp)
66+
.clip(shape = CircleShape)
67+
.clickable {
68+
onDismissRequest()
69+
},
70+
)
71+
}
72+
}
73+
74+
content()
75+
}
4276
}
4377

4478
@Preview(showBackground = true)
@@ -48,20 +82,15 @@ private fun NDGLBottomSheetWithHandlePreview() {
4882
NDGLBottomSheet(
4983
onDismissRequest = {},
5084
showDragHandle = true,
85+
title = "바텀시트 제목",
5186
) {
5287
Column(
5388
modifier = Modifier
5489
.fillMaxWidth()
5590
.padding(24.dp),
5691
) {
57-
Text(
58-
text = "바텀시트 제목",
59-
style = NDGLTheme.typography.subtitleLgSemiBold,
60-
color = NDGLTheme.colors.black900,
61-
)
6292
Text(
6393
text = "바텀시트 내용입니다.",
64-
modifier = Modifier.padding(top = 16.dp),
6594
style = NDGLTheme.typography.bodyLgMedium,
6695
color = NDGLTheme.colors.black500,
6796
)
@@ -77,20 +106,15 @@ private fun NDGLBottomSheetWithoutHandlePreview() {
77106
NDGLBottomSheet(
78107
onDismissRequest = {},
79108
showDragHandle = false,
109+
title = "바텀시트 제목",
80110
) {
81111
Column(
82112
modifier = Modifier
83113
.fillMaxWidth()
84114
.padding(24.dp),
85115
) {
86-
Text(
87-
text = "바텀시트 제목",
88-
style = NDGLTheme.typography.subtitleLgSemiBold,
89-
color = NDGLTheme.colors.black900,
90-
)
91116
Text(
92117
text = "바텀시트 내용입니다.",
93-
modifier = Modifier.padding(top = 16.dp),
94118
style = NDGLTheme.typography.bodyLgMedium,
95119
color = NDGLTheme.colors.black500,
96120
)

feature/travel/src/main/java/com/yapp/ndgl/feature/travel/traveldetail/TravelDetailScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,11 +495,11 @@ private fun TravelDetailScreen(
495495
NDGLBottomSheet(
496496
onDismissRequest = dismissTimelineBottomSheet,
497497
showDragHandle = false,
498+
title = stringResource(R.string.schedule_setting_title),
498499
) {
499500
TimelineContent(
500501
startTime = state.startTime ?: 8.hours,
501502
totalDuration = state.itineraries.getOrNull(state.selectedDay - 1)?.totalDuration ?: 0.hours,
502-
onDismissRequest = dismissTimelineBottomSheet,
503503
onConfirm = confirmTimelineSetting,
504504
)
505505
}

feature/travel/src/main/java/com/yapp/ndgl/feature/travel/traveldetail/component/TimelineContent.kt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ import kotlin.time.Duration.Companion.minutes
5656
internal fun TimelineContent(
5757
startTime: Duration,
5858
totalDuration: Duration,
59-
onDismissRequest: () -> Unit,
6059
onConfirm: (Duration) -> Unit,
6160
) {
6261
var isSettingStartTime by remember { mutableStateOf(false) }
@@ -68,33 +67,6 @@ internal fun TimelineContent(
6867
.fillMaxWidth()
6968
.padding(24.dp),
7069
) {
71-
Row(
72-
modifier = Modifier.fillMaxWidth(),
73-
verticalAlignment = Alignment.CenterVertically,
74-
) {
75-
Text(
76-
text = stringResource(R.string.schedule_setting_title),
77-
color = NDGLTheme.colors.black900,
78-
style = NDGLTheme.typography.titleMdSemiBold,
79-
)
80-
Spacer(Modifier.weight(1f))
81-
Box(
82-
modifier = Modifier
83-
.size(32.dp)
84-
.clip(RoundedCornerShape(8.dp))
85-
.background(NDGLTheme.colors.black50)
86-
.clickable { onDismissRequest() }
87-
.padding(8.dp),
88-
) {
89-
Icon(
90-
imageVector = ImageVector.vectorResource(R.drawable.ic_24_close),
91-
contentDescription = null,
92-
tint = NDGLTheme.colors.black900,
93-
)
94-
}
95-
}
96-
Spacer(Modifier.height(32.dp))
97-
9870
if (isSettingStartTime) {
9971
val hourItems = remember { (0..23).toList() }
10072
val minuteItems = remember { (0..55 step 5).toList() }
@@ -323,7 +295,6 @@ private fun TimelineContentPreview() {
323295
TimelineContent(
324296
startTime = 9.hours,
325297
totalDuration = 16.hours,
326-
onDismissRequest = {},
327298
onConfirm = {},
328299
)
329300
}

0 commit comments

Comments
 (0)