Skip to content

Commit 058684d

Browse files
committed
모임 생성 화면 디자인 반영
1 parent a4774ca commit 058684d

File tree

3 files changed

+70
-80
lines changed

3 files changed

+70
-80
lines changed
3.48 KB
Loading
352 KB
Loading
Lines changed: 70 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
package com.plottwist.join_gathering
22

3-
import androidx.compose.foundation.layout.Arrangement
3+
import android.annotation.SuppressLint
44
import androidx.compose.foundation.layout.Box
55
import androidx.compose.foundation.layout.Column
66
import androidx.compose.foundation.layout.PaddingValues
7-
import androidx.compose.foundation.layout.Row
8-
import androidx.compose.foundation.layout.Spacer
97
import androidx.compose.foundation.layout.aspectRatio
108
import androidx.compose.foundation.layout.fillMaxSize
119
import androidx.compose.foundation.layout.fillMaxWidth
1210
import androidx.compose.foundation.layout.height
11+
import androidx.compose.foundation.layout.imePadding
1312
import androidx.compose.foundation.layout.padding
13+
import androidx.compose.foundation.layout.requiredWidth
1414
import androidx.compose.foundation.shape.RoundedCornerShape
1515
import androidx.compose.material3.Button
1616
import androidx.compose.material3.ButtonDefaults
1717
import androidx.compose.material3.IconButton
1818
import androidx.compose.material3.MaterialTheme
19+
import androidx.compose.material3.Scaffold
1920
import androidx.compose.material3.SnackbarDuration
2021
import androidx.compose.material3.SnackbarHost
2122
import androidx.compose.material3.SnackbarHostState
@@ -27,26 +28,27 @@ import androidx.compose.runtime.remember
2728
import androidx.compose.runtime.rememberCoroutineScope
2829
import androidx.compose.ui.Alignment
2930
import androidx.compose.ui.Modifier
31+
import androidx.compose.ui.draw.BlurredEdgeTreatment
32+
import androidx.compose.ui.draw.blur
33+
import androidx.compose.ui.draw.drawWithContent
3034
import androidx.compose.ui.graphics.Color
35+
import androidx.compose.ui.graphics.drawscope.clipRect
3136
import androidx.compose.ui.layout.ContentScale
32-
import androidx.compose.ui.text.TextStyle
33-
import androidx.compose.ui.text.font.FontWeight
37+
import androidx.compose.ui.platform.LocalConfiguration
3438
import androidx.compose.ui.text.style.TextAlign
3539
import androidx.compose.ui.tooling.preview.Preview
3640
import androidx.compose.ui.unit.dp
37-
import androidx.compose.ui.unit.sp
3841
import androidx.hilt.navigation.compose.hiltViewModel
3942
import androidx.lifecycle.compose.collectAsStateWithLifecycle
43+
import com.plottwist.core.designsystem.R
4044
import com.plottwist.core.designsystem.component.TukTopAppBar
41-
import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray300
42-
import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray500
43-
import com.plottwist.core.designsystem.foundation.TukColorTokens.Gray700
4445
import com.plottwist.core.designsystem.foundation.TukPrimitivesColor
4546
import com.plottwist.core.designsystem.foundation.type.TukSerifTypography
4647
import com.plottwist.core.ui.component.StableImage
47-
import com.plottwist.core.ui.component.TukScaffold
48+
import com.plottwist.core.ui.component.TukScaffoldTitle
4849
import kotlinx.coroutines.launch
4950

51+
@SuppressLint("ConfigurationScreenWidthHeight")
5052
@Composable
5153
fun JoinGatheringScreen(
5254
onCloseClicked: () -> Unit = {},
@@ -57,6 +59,7 @@ fun JoinGatheringScreen(
5759
val state by viewModel.container.stateFlow.collectAsStateWithLifecycle()
5860
val snackbarHostState = remember { SnackbarHostState() }
5961
val coroutineScope = rememberCoroutineScope()
62+
val localConfiguration = LocalConfiguration.current
6063

6164
LaunchedEffect(Unit) {
6265
viewModel.container.sideEffectFlow.collect { sideEffect ->
@@ -84,113 +87,89 @@ fun JoinGatheringScreen(
8487
Box(
8588
modifier = Modifier
8689
) {
90+
8791
StableImage(
8892
modifier = Modifier
89-
.fillMaxWidth()
90-
.align(Alignment.BottomEnd),
91-
drawableResId = R.drawable.image_join_gathering_gradient,
93+
.fillMaxWidth() .requiredWidth(
94+
localConfiguration.screenWidthDp.dp * GRADIENT_BACKGROUND_IMAGE_SCALE
95+
),
96+
drawableResId = R.drawable.image_home_gradient,
9297
contentScale = ContentScale.FillWidth
9398
)
9499

95-
TukScaffold (
96-
containerColor = Color.Transparent,
97-
snackbarHost = {
98-
SnackbarHost(
99-
hostState = snackbarHostState
100-
)
101-
},
100+
Scaffold(
101+
modifier = Modifier
102+
.fillMaxSize()
103+
.imePadding(),
102104
topBar = {
103105
JoinGatheringAppBar(
104106
onCloseClicked = onCloseClicked
105107
)
106108
},
107-
title = "모임에\n참여하시겠어요?",
108109
bottomBar = {
109110
JoinGatheringButton(
110111
onClick = {
111112
viewModel.handleAction(JoinGatheringAction.ClickJoin)
112113
}
113114
)
114-
}
115-
) {
116-
item {
115+
},
116+
snackbarHost = {
117+
SnackbarHost(
118+
hostState = snackbarHostState
119+
)
120+
},
121+
containerColor = Color.Transparent
122+
) { innerPadding ->
123+
Column (
124+
modifier = Modifier
125+
.fillMaxSize()
126+
.padding(innerPadding)
127+
) {
128+
TukScaffoldTitle(
129+
title = "모임에\n참여하시겠어요?",
130+
modifier = Modifier.padding(horizontal = 20.dp)
131+
)
117132
JoinGatheringContent(
118133
modifier = Modifier
119-
.fillMaxWidth()
120-
.padding(vertical = 60.dp),
121-
gatheringName = state.gatheringName
134+
.fillMaxWidth(),
135+
gatheringName = state.gatheringName,
136+
screenWidth = localConfiguration.screenWidthDp.toFloat(),
137+
screenHeight = localConfiguration.screenHeightDp.toFloat()
122138
)
123139
}
124140
}
125-
126141
}
127142
}
128143

129144
@Composable
130145
fun JoinGatheringContent(
131146
gatheringName: String,
147+
screenWidth : Float,
148+
screenHeight: Float,
132149
modifier: Modifier
133150
) {
134151
Box(
135-
modifier = Modifier
136-
.fillMaxWidth()
137-
.aspectRatio(288f / 349f),
152+
modifier = Modifier.fillMaxSize(),
153+
contentAlignment = Alignment.Center
138154
) {
139-
StableImage(
140-
modifier = Modifier
141-
.fillMaxSize()
142-
.padding(horizontal = 10.dp),
143-
drawableResId = R.drawable.image_join_gathering_card
144-
)
145-
146155
Box(
147-
modifier = Modifier
156+
Modifier
148157
.fillMaxWidth()
149-
.padding(24.dp)
150158
) {
151159
StableImage(
152-
modifier = Modifier.fillMaxSize(),
153-
drawableResId = R.drawable.image_join_gathering_card,
154-
contentScale = ContentScale.FillBounds
155-
)
156-
157-
Column(
158160
modifier = Modifier
159-
.fillMaxSize()
160-
.padding(horizontal = 24.dp, vertical = 36.dp),
161-
verticalArrangement = Arrangement.SpaceBetween
162-
) {
163-
Box(
164-
modifier = Modifier
165-
.fillMaxWidth()
166-
.padding(top = 63.dp),
167-
contentAlignment = Alignment.Center
168-
) {
169-
Text(
170-
text = gatheringName,
171-
textAlign = TextAlign.Center,
172-
style = TukSerifTypography.title22M
173-
)
174-
}
161+
.fillMaxWidth()
162+
.aspectRatio(260f/364f),
163+
drawableResId = R.drawable.img_join_card,
164+
contentScale = ContentScale.FillWidth
165+
)
175166

176-
Row(
177-
modifier = Modifier
178-
.fillMaxWidth()
179-
.padding(start = 38.dp, end = 38.dp, bottom = 33.dp),
180-
horizontalArrangement = Arrangement.SpaceBetween
181-
) {
182-
Text(
183-
text = "연락이",
184-
style = TukSerifTypography.body14R,
185-
color = Gray700
186-
)
187-
Text(
188-
text = "뜸해진 우리",
189-
style = TukSerifTypography.body14R,
190-
color = Gray700
191-
)
192-
}
193-
}
167+
Text(
168+
modifier = Modifier.align(Alignment.Center),
169+
text = "$gatheringName\n친구들에게",
170+
style = TukSerifTypography.title18M,
171+
textAlign = TextAlign.Center
172+
)
194173
}
195174
}
196175
}
@@ -249,3 +228,14 @@ fun TopAppBarCloseButton(
249228
)
250229
}
251230
}
231+
232+
private const val GRADIENT_BACKGROUND_IMAGE_SCALE = 3
233+
234+
@Preview
235+
@Composable
236+
private fun JoinGatheringScreenPreview() {
237+
JoinGatheringScreen(
238+
onNavigateToGatheringDetail = {},
239+
onNavigateToLoginScreen = {}
240+
)
241+
}

0 commit comments

Comments
 (0)