From e9a360f14448dbf7aa88ff82527440af1e12f52e Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 05:46:38 +0900 Subject: [PATCH 01/12] =?UTF-8?q?[FEAT/#53]=20TerningDialog=20=EB=9D=84?= =?UTF-8?q?=EC=9A=B0=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/TerningDialog.kt | 66 +++++++++++++++++++ .../terning/core/designsystem/theme/Color.kt | 1 + .../feature/onboarding/signin/SignInRoute.kt | 19 +++++- 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt new file mode 100644 index 000000000..585b8bfa6 --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt @@ -0,0 +1,66 @@ +package com.terning.core.designsystem.component.dialog + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Card +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import com.terning.core.designsystem.theme.BackgroundColor + +@Composable +fun TerningDialog( + onDismissRequest: () -> Unit, + properties: DialogProperties = DialogProperties(), + content: @Composable () -> Unit, +) { + Column( + modifier = Modifier.fillMaxSize(). + background(BackgroundColor), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Dialog( + onDismissRequest = { onDismissRequest() }, + properties = properties, + ) { + content() + } + } +} + +@Composable +fun DialogContent() { + Card( + modifier = Modifier + .fillMaxWidth() + .height(200.dp) + .padding(16.dp), + shape = RoundedCornerShape(20.dp), + ) { + Text( + text = "This is a minimal dialog", + modifier = Modifier + .fillMaxSize() + .wrapContentSize(Alignment.Center), + textAlign = TextAlign.Center, + ) + } +} + +@Preview(showBackground = true) +@Composable +fun TerningDialogPreview() { + TerningDialog(onDismissRequest = {}, content = { DialogContent() }) +} \ No newline at end of file diff --git a/core/src/main/java/com/terning/core/designsystem/theme/Color.kt b/core/src/main/java/com/terning/core/designsystem/theme/Color.kt index e9ed4d1be..d0cf63b58 100644 --- a/core/src/main/java/com/terning/core/designsystem/theme/Color.kt +++ b/core/src/main/java/com/terning/core/designsystem/theme/Color.kt @@ -27,6 +27,7 @@ val TerningSub5 = Color(0XFFF8FFFB) // Background val Back = Color(0xFFF8F8F8) val ToastGrey = Color(0XFF666666) +val BackgroundColor = Color(0x4C000000) // Calendar Color val CalRed = Color(0xFFED4E54) diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index 2aae08178..90b1e75ab 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -9,6 +9,8 @@ import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext @@ -21,10 +23,11 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController +import com.terning.core.designsystem.component.dialog.DialogContent +import com.terning.core.designsystem.component.dialog.TerningDialog import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.extension.toast import com.terning.feature.R -import com.terning.feature.home.home.navigation.navigateHome import com.terning.feature.onboarding.signin.component.KakaoButton import com.terning.feature.onboarding.signup.navigation.navigateSignUp @@ -57,6 +60,8 @@ fun SignInScreen( modifier: Modifier = Modifier, onSignInClick: () -> Unit = {}, ) { + val openDialog = remember { mutableStateOf(false) } + Column( modifier = modifier .wrapContentHeight() @@ -72,11 +77,21 @@ fun SignInScreen( KakaoButton( title = stringResource(id = R.string.sign_in_kakao_button), onSignInClick = { - onSignInClick() +// onSignInClick() + openDialog.value = true }, modifier = modifier.padding(horizontal = 20.dp) ) } + + when { + openDialog.value -> { + TerningDialog( + onDismissRequest = { openDialog.value = false }, + content = { DialogContent() } + ) + } + } } @Preview(showBackground = true) From 24a8a7915b83bc8e9a083559b7b3f5b1869eb1e4 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 14:37:20 +0900 Subject: [PATCH 02/12] =?UTF-8?q?[FEAT/#53]=20TerningDialog=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/src/main/AndroidManifest.xml | 3 ++- .../com/terning/feature}/dialog/TerningDialog.kt | 13 +++++++++---- .../feature/onboarding/signin/SignInRoute.kt | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) rename {core/src/main/java/com/terning/core/designsystem/component => feature/src/main/java/com/terning/feature}/dialog/TerningDialog.kt (84%) diff --git a/feature/src/main/AndroidManifest.xml b/feature/src/main/AndroidManifest.xml index f136894fe..708160b1c 100644 --- a/feature/src/main/AndroidManifest.xml +++ b/feature/src/main/AndroidManifest.xml @@ -18,7 +18,8 @@ + android:exported="true" + android:windowSoftInputMode = "adjustResize" > diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt similarity index 84% rename from core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt rename to feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt index 585b8bfa6..21aed4a28 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt +++ b/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt @@ -1,4 +1,4 @@ -package com.terning.core.designsystem.component.dialog +package com.terning.feature.dialog import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card @@ -23,12 +24,16 @@ import com.terning.core.designsystem.theme.BackgroundColor @Composable fun TerningDialog( onDismissRequest: () -> Unit, - properties: DialogProperties = DialogProperties(), + properties: DialogProperties = DialogProperties( + usePlatformDefaultWidth = false, + decorFitsSystemWindows = false + ), content: @Composable () -> Unit, ) { Column( - modifier = Modifier.fillMaxSize(). - background(BackgroundColor), + modifier = Modifier + .fillMaxSize() + .background(BackgroundColor), horizontalAlignment = Alignment.CenterHorizontally, ) { Dialog( diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index 90b1e75ab..a477428bc 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -23,8 +23,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController -import com.terning.core.designsystem.component.dialog.DialogContent -import com.terning.core.designsystem.component.dialog.TerningDialog +import com.terning.feature.dialog.DialogContent +import com.terning.feature.dialog.TerningDialog import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.extension.toast import com.terning.feature.R From 21b6e7ffba5b42140a855f4dd6b317f859131227 Mon Sep 17 00:00:00 2001 From: boiledegg Date: Fri, 12 Jul 2024 14:51:16 +0900 Subject: [PATCH 03/12] =?UTF-8?q?[UI/#53]=20=EB=8B=A4=EC=9D=B4=EC=96=BC?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=20Properties=20=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/terning/feature/dialog/TerningDialog.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt b/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt index 21aed4a28..4eb9484e3 100644 --- a/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt +++ b/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt @@ -26,7 +26,9 @@ fun TerningDialog( onDismissRequest: () -> Unit, properties: DialogProperties = DialogProperties( usePlatformDefaultWidth = false, - decorFitsSystemWindows = false + decorFitsSystemWindows = true, + dismissOnBackPress = true, + dismissOnClickOutside = true, ), content: @Composable () -> Unit, ) { @@ -64,7 +66,7 @@ fun DialogContent() { } } -@Preview(showBackground = true) +@Preview(showBackground = true, showSystemUi = true) @Composable fun TerningDialogPreview() { TerningDialog(onDismissRequest = {}, content = { DialogContent() }) From 4dc84b8a4c4800abb89f8d7fac055227dc7fd5d0 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 15:46:47 +0900 Subject: [PATCH 04/12] =?UTF-8?q?[FEAT/#53]=20TerningDialog=20Column=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/TerningDialog.kt | 80 +++++++++++++++++++ core/src/main/res/drawable/ic_dialog_x_32.xml | 13 +++ core/src/main/res/ic_dialog_x_32.xml | 13 +++ .../terning/feature/dialog/TerningDialog.kt | 73 ----------------- .../feature/onboarding/signin/SignInRoute.kt | 10 ++- 5 files changed, 113 insertions(+), 76 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt create mode 100644 core/src/main/res/drawable/ic_dialog_x_32.xml create mode 100644 core/src/main/res/ic_dialog_x_32.xml delete mode 100644 feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt new file mode 100644 index 000000000..99f6c73ec --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt @@ -0,0 +1,80 @@ +package com.terning.core.designsystem.component.dialog + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import com.terning.core.R +import com.terning.core.designsystem.theme.White + +@Composable +fun TerningDialog( + onDismissRequest: () -> Unit, + properties: DialogProperties = DialogProperties( + usePlatformDefaultWidth = false, + decorFitsSystemWindows = true, + dismissOnBackPress = true, + dismissOnClickOutside = true, + ), + content: @Composable () -> Unit, +) { + Dialog( + onDismissRequest = { onDismissRequest() }, + properties = properties, + ) { + content() + } +} + +@Composable +fun DialogContent( + onDismissRequest: () -> Unit, +) { + Box( + modifier = Modifier + .fillMaxWidth() + .height(200.dp) + .padding(30.dp) + .background( + color = White, + shape = RoundedCornerShape(20.dp) + ), + ) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.End + ) { + IconButton(onClick = { onDismissRequest() }) { + Icon( + painter = painterResource(id = R.drawable.ic_dialog_x_32), + contentDescription = null + ) + } + } + } +} + +@Preview(showBackground = true, showSystemUi = true) +@Composable +fun TerningDialogPreview() { + TerningDialog( + onDismissRequest = {}, + content = { + DialogContent( + onDismissRequest = {} + ) + }) +} \ No newline at end of file diff --git a/core/src/main/res/drawable/ic_dialog_x_32.xml b/core/src/main/res/drawable/ic_dialog_x_32.xml new file mode 100644 index 000000000..93d2fd06f --- /dev/null +++ b/core/src/main/res/drawable/ic_dialog_x_32.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/core/src/main/res/ic_dialog_x_32.xml b/core/src/main/res/ic_dialog_x_32.xml new file mode 100644 index 000000000..93d2fd06f --- /dev/null +++ b/core/src/main/res/ic_dialog_x_32.xml @@ -0,0 +1,13 @@ + + + + + + diff --git a/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt b/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt deleted file mode 100644 index 4eb9484e3..000000000 --- a/feature/src/main/java/com/terning/feature/dialog/TerningDialog.kt +++ /dev/null @@ -1,73 +0,0 @@ -package com.terning.feature.dialog - -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.statusBarsPadding -import androidx.compose.foundation.layout.wrapContentSize -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Card -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp -import androidx.compose.ui.window.Dialog -import androidx.compose.ui.window.DialogProperties -import com.terning.core.designsystem.theme.BackgroundColor - -@Composable -fun TerningDialog( - onDismissRequest: () -> Unit, - properties: DialogProperties = DialogProperties( - usePlatformDefaultWidth = false, - decorFitsSystemWindows = true, - dismissOnBackPress = true, - dismissOnClickOutside = true, - ), - content: @Composable () -> Unit, -) { - Column( - modifier = Modifier - .fillMaxSize() - .background(BackgroundColor), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - Dialog( - onDismissRequest = { onDismissRequest() }, - properties = properties, - ) { - content() - } - } -} - -@Composable -fun DialogContent() { - Card( - modifier = Modifier - .fillMaxWidth() - .height(200.dp) - .padding(16.dp), - shape = RoundedCornerShape(20.dp), - ) { - Text( - text = "This is a minimal dialog", - modifier = Modifier - .fillMaxSize() - .wrapContentSize(Alignment.Center), - textAlign = TextAlign.Center, - ) - } -} - -@Preview(showBackground = true, showSystemUi = true) -@Composable -fun TerningDialogPreview() { - TerningDialog(onDismissRequest = {}, content = { DialogContent() }) -} \ No newline at end of file diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index a477428bc..9beaa15a7 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -23,8 +23,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController -import com.terning.feature.dialog.DialogContent -import com.terning.feature.dialog.TerningDialog +import com.terning.core.designsystem.component.dialog.DialogContent +import com.terning.core.designsystem.component.dialog.TerningDialog import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.extension.toast import com.terning.feature.R @@ -88,7 +88,11 @@ fun SignInScreen( openDialog.value -> { TerningDialog( onDismissRequest = { openDialog.value = false }, - content = { DialogContent() } + content = { + DialogContent( + onDismissRequest = { openDialog.value = false } + ) + } ) } } From 853987684590ab18b05b9b47d6a1fead29108f12 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 16:09:58 +0900 Subject: [PATCH 05/12] =?UTF-8?q?[FEAT/#53]=20DialogContent=20=EA=B3=B5?= =?UTF-8?q?=EA=B3=A0=20=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/TerningDialog.kt | 75 ++++++++++++++++++- core/src/main/res/ic_dialog_x_32.xml | 13 ---- 2 files changed, 72 insertions(+), 16 deletions(-) delete mode 100644 core/src/main/res/ic_dialog_x_32.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt index 99f6c73ec..0e6209494 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt @@ -1,23 +1,38 @@ package com.terning.core.designsystem.component.dialog +import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import com.terning.core.R +import com.terning.core.designsystem.theme.Grey200 +import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.Grey350 +import com.terning.core.designsystem.theme.Grey500 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White @Composable @@ -46,7 +61,7 @@ fun DialogContent( Box( modifier = Modifier .fillMaxWidth() - .height(200.dp) + .wrapContentHeight() .padding(30.dp) .background( color = White, @@ -57,16 +72,70 @@ fun DialogContent( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End ) { - IconButton(onClick = { onDismissRequest() }) { + IconButton(onClick = { onDismissRequest() }, modifier = Modifier.padding(6.dp)) { Icon( painter = painterResource(id = R.drawable.ic_dialog_x_32), - contentDescription = null + contentDescription = null, + tint = Grey300 + ) + } + } + Box( + modifier = Modifier + .fillMaxWidth() + .padding(top = 32.dp), + contentAlignment = Alignment.TopCenter + ) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 11.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Row( + modifier = Modifier + .width(60.dp) + .height(60.dp) + .border( + width = 1.dp, + color = TerningMain, + shape = RoundedCornerShape(size = 15.dp) + ) + ) { + Image( + painter = painterResource( + id = R.drawable.ic_character1 + ), + modifier = Modifier + .fillMaxWidth() + .background( + Grey200, + shape = RoundedCornerShape(size = 15.dp) + ), + contentDescription = null, + contentScale = ContentScale.Fit, + alignment = Alignment.Center + ) + } + Text( + text = "[한양대학교 컬렉티브임팩트센터] /코이카 영프로페셔널(YP) 모집합니다", + textAlign = TextAlign.Center, + style = TerningTheme.typography.title4, + color = Grey500, + modifier = Modifier.padding(top = 20.dp) + ) + Text( + text = "공고를 캘린더에 스크랩하시겠어요?", + style = TerningTheme.typography.body5, + color = Grey350, + modifier = Modifier.padding(top = 4.dp) ) } } } } + @Preview(showBackground = true, showSystemUi = true) @Composable fun TerningDialogPreview() { diff --git a/core/src/main/res/ic_dialog_x_32.xml b/core/src/main/res/ic_dialog_x_32.xml deleted file mode 100644 index 93d2fd06f..000000000 --- a/core/src/main/res/ic_dialog_x_32.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - From 36818369ce67926754c3631faa494422a97c3897 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 16:42:43 +0900 Subject: [PATCH 06/12] =?UTF-8?q?[FEAT/#53]=20DialogContent=20=EC=83=89?= =?UTF-8?q?=EC=83=81=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/button/SortingButton.kt | 2 +- .../component/dialog/TerningDialog.kt | 54 ++++++++++++++++++- .../drawable/{ic_down.xml => ic_down_18.xml} | 0 core/src/main/res/drawable/ic_down_22.xml | 10 ++++ core/src/main/res/values/strings.xml | 2 + 5 files changed, 66 insertions(+), 2 deletions(-) rename core/src/main/res/drawable/{ic_down.xml => ic_down_18.xml} (100%) create mode 100644 core/src/main/res/drawable/ic_down_22.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt b/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt index 79c6c28f0..27693a251 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/button/SortingButton.kt @@ -39,7 +39,7 @@ fun SortingButton( ) ) Image( - painter = painterResource(id = R.drawable.ic_down), + painter = painterResource(id = R.drawable.ic_down_18), contentDescription = stringResource(id = R.string.sort_button_description), modifier = modifier .padding(vertical = 5.dp) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt index 0e6209494..955911a95 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt @@ -13,6 +13,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.Text @@ -21,12 +22,14 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import com.terning.core.R +import com.terning.core.designsystem.theme.CalGreen2 import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.Grey350 @@ -34,6 +37,7 @@ import com.terning.core.designsystem.theme.Grey500 import com.terning.core.designsystem.theme.TerningMain import com.terning.core.designsystem.theme.TerningTheme import com.terning.core.designsystem.theme.White +import com.terning.core.extension.noRippleClickable @Composable fun TerningDialog( @@ -128,8 +132,56 @@ fun DialogContent( text = "공고를 캘린더에 스크랩하시겠어요?", style = TerningTheme.typography.body5, color = Grey350, - modifier = Modifier.padding(top = 4.dp) + modifier = Modifier.padding( + top = 4.dp, + bottom = 13.dp + ) ) + Column( + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Top, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 13.dp) + ) { + Row( + modifier = Modifier + .background( + color = CalGreen2, + shape = RoundedCornerShape(14.dp) + ) + .noRippleClickable { }, + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start + ) { + Icon( + painter = painterResource(id = R.drawable.ic_down_22), + contentDescription = stringResource( + id = R.string.dialog_content_color_button + ), + tint = White, + modifier = Modifier.padding( + start = 7.dp, + top = 2.dp, + bottom = 2.dp + ) + ) + Text( + text = stringResource(id = R.string.dialog_content_color_button), + style = TerningTheme.typography.body5, + color = White, + modifier = Modifier.padding(end = 13.dp) + ) + } + HorizontalDivider( + thickness = 1.dp, + color = Grey200, + modifier = Modifier.padding( + top = 11.dp, + bottom = 8.dp + ) + ) + } } } } diff --git a/core/src/main/res/drawable/ic_down.xml b/core/src/main/res/drawable/ic_down_18.xml similarity index 100% rename from core/src/main/res/drawable/ic_down.xml rename to core/src/main/res/drawable/ic_down_18.xml diff --git a/core/src/main/res/drawable/ic_down_22.xml b/core/src/main/res/drawable/ic_down_22.xml new file mode 100644 index 000000000..504567d88 --- /dev/null +++ b/core/src/main/res/drawable/ic_down_22.xml @@ -0,0 +1,10 @@ + + + diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index b9a310626..16b005e5d 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -36,4 +36,6 @@ 회원가입 바텀시트 저장하기 + + 색상 \ No newline at end of file From 1902f2626c9dc52a06dd7538e9f680e819a91846 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 17:04:07 +0900 Subject: [PATCH 07/12] =?UTF-8?q?[FEAT/#53]=20DialogContent=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=9E=A9=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/TerningDialog.kt | 51 +++++++++++++++++++ core/src/main/res/values/strings.xml | 1 + 2 files changed, 52 insertions(+) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt index 955911a95..95a8bc56c 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import com.terning.core.R +import com.terning.core.designsystem.component.button.RoundButton import com.terning.core.designsystem.theme.CalGreen2 import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.Grey300 @@ -181,12 +182,62 @@ fun DialogContent( bottom = 8.dp ) ) + Text( + text = "D-3", + style = TerningTheme.typography.body5, + color = TerningMain, + modifier = Modifier.padding(bottom = 9.dp) + ) + Column( + modifier = Modifier.padding( + bottom = 29.dp + ), + verticalArrangement = Arrangement.spacedBy( + 5.dp, + Alignment.CenterVertically + ), + horizontalAlignment = Alignment.Start, + ) { + listOf( + "서류 마감" to "2024년 7월 23일", + "근무 기간" to "2개월", + "근무 시작" to "2024년 8월" + ).forEach { (title, value) -> + InternInfoRow(title, value) + } + } } + RoundButton( + style = TerningTheme.typography.button3, + paddingVertical = 12.dp, + cornerRadius = 8.dp, + text = R.string.dialog_scrap_button, + onButtonClick = { /*TODO*/ }, + modifier = Modifier.padding(bottom = 8.dp) + ) } } } } +@Composable +fun InternInfoRow(title: String, value: String) { + Row( + horizontalArrangement = Arrangement.spacedBy(12.dp, Alignment.Start), + verticalAlignment = Alignment.Top, + ) { + Text( + text = title, + style = TerningTheme.typography.body2, + color = Grey350, + ) + Text( + text = value, + style = TerningTheme.typography.body3, + color = Grey500, + ) + } +} @Preview(showBackground = true, showSystemUi = true) @Composable diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 16b005e5d..500c405de 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -38,4 +38,5 @@ 색상 + 내 캘린더에 스크랩하기 \ No newline at end of file From 967aa92a55f7ec02736dc7a16aac45bf5eb926dd Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 17:39:43 +0900 Subject: [PATCH 08/12] =?UTF-8?q?[FEAT/#53]=20DialogContent=20=EC=83=89?= =?UTF-8?q?=EC=83=81=20=EB=B2=84=ED=8A=BC=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/ScrapDialogContent.kt | 240 ++++++++++++++++++ .../component/dialog/TerningDialog.kt | 221 +--------------- core/src/main/res/drawable/ic_up_22.xml | 10 + .../feature/onboarding/signin/SignInRoute.kt | 3 +- 4 files changed, 256 insertions(+), 218 deletions(-) create mode 100644 core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt create mode 100644 core/src/main/res/drawable/ic_up_22.xml diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt new file mode 100644 index 000000000..d50fce77f --- /dev/null +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt @@ -0,0 +1,240 @@ +package com.terning.core.designsystem.component.dialog + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.HorizontalDivider +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import com.terning.core.R +import com.terning.core.designsystem.component.button.RoundButton +import com.terning.core.designsystem.theme.CalGreen2 +import com.terning.core.designsystem.theme.Grey200 +import com.terning.core.designsystem.theme.Grey300 +import com.terning.core.designsystem.theme.Grey350 +import com.terning.core.designsystem.theme.Grey500 +import com.terning.core.designsystem.theme.TerningMain +import com.terning.core.designsystem.theme.TerningTheme +import com.terning.core.designsystem.theme.White +import com.terning.core.extension.noRippleClickable + + +@Composable +fun DialogContent( + onDismissRequest: () -> Unit, + isScrapped: Boolean, +) { + var isColorChange by remember { mutableStateOf(false) } + + Box( + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .padding(30.dp) + .background( + color = White, + shape = RoundedCornerShape(20.dp) + ), + ) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.End + ) { + IconButton(onClick = { onDismissRequest() }, modifier = Modifier.padding(6.dp)) { + Icon( + painter = painterResource(id = R.drawable.ic_dialog_x_32), + contentDescription = null, + tint = Grey300 + ) + } + } + Box( + modifier = Modifier + .fillMaxWidth() + .padding(top = 32.dp), + contentAlignment = Alignment.TopCenter + ) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 11.dp), + horizontalAlignment = Alignment.CenterHorizontally + ) { + Row( + modifier = Modifier + .width(60.dp) + .height(60.dp) + .border( + width = 1.dp, + color = TerningMain, + shape = RoundedCornerShape(size = 15.dp) + ) + ) { + Image( + painter = painterResource( + id = R.drawable.ic_character1 + ), + modifier = Modifier + .fillMaxWidth() + .background( + Grey200, + shape = RoundedCornerShape(size = 15.dp) + ), + contentDescription = null, + contentScale = ContentScale.Fit, + alignment = Alignment.Center + ) + } + Text( + text = "[한양대학교 컬렉티브임팩트센터] /코이카 영프로페셔널(YP) 모집합니다", + textAlign = TextAlign.Center, + style = TerningTheme.typography.title4, + color = Grey500, + modifier = Modifier.padding(top = 20.dp) + ) + Text( + text = "공고를 캘린더에 스크랩하시겠어요?", + style = TerningTheme.typography.body5, + color = Grey350, + modifier = Modifier.padding( + top = 4.dp, + bottom = 13.dp + ) + ) + Column( + horizontalAlignment = Alignment.Start, + verticalArrangement = Arrangement.Top, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 13.dp) + ) { + Row( + modifier = Modifier + .background( + color = CalGreen2, + shape = RoundedCornerShape(14.dp) + ) + .noRippleClickable { + isColorChange = !isColorChange + }, + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start + ) { + Icon( + painter = painterResource( + id = if (isColorChange) R.drawable.ic_up_22 + else R.drawable.ic_down_22 + ), + contentDescription = stringResource( + id = R.string.dialog_content_color_button + ), + tint = White, + modifier = Modifier.padding( + start = 7.dp, + top = 2.dp, + bottom = 2.dp + ) + ) + Text( + text = stringResource(id = R.string.dialog_content_color_button), + style = TerningTheme.typography.body5, + color = White, + modifier = Modifier.padding(end = 13.dp) + ) + } + HorizontalDivider( + thickness = 1.dp, + color = Grey200, + modifier = Modifier.padding( + top = 11.dp, + bottom = 8.dp + ) + ) + if (isColorChange) { + Text(text = "컬러 팔레트") + } else { + Text( + text = "D-3", + style = TerningTheme.typography.body5, + color = TerningMain, + modifier = Modifier.padding(bottom = 9.dp) + ) + Column( + modifier = Modifier.padding(bottom = 29.dp), + verticalArrangement = Arrangement.spacedBy( + 5.dp, + Alignment.CenterVertically + ), + horizontalAlignment = Alignment.Start, + ) { + listOf( + "서류 마감" to "2024년 7월 23일", + "근무 기간" to "2개월", + "근무 시작" to "2024년 8월" + ).forEach { (title, value) -> + InternInfoRow(title, value) + } + } + } + } + RoundButton( + style = TerningTheme.typography.button3, + paddingVertical = 12.dp, + cornerRadius = 8.dp, + text = if (isScrapped) { + if (isColorChange) + R.string.dialog_content_color_button + else R.string.dialog_scrap_button + } else { + R.string.dialog_scrap_button + }, + onButtonClick = { /*TODO*/ }, + modifier = Modifier.padding(bottom = 8.dp) + ) + } + } + } +} + +// TODO 삭제 +@Composable +fun InternInfoRow(title: String, value: String) { + Row( + horizontalArrangement = Arrangement.spacedBy(12.dp, Alignment.Start), + verticalAlignment = Alignment.Top, + ) { + Text( + text = title, + style = TerningTheme.typography.body2, + color = Grey350, + ) + Text( + text = value, + style = TerningTheme.typography.body3, + color = Grey500, + ) + } +} diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt index 95a8bc56c..8f6c05a46 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt @@ -1,44 +1,9 @@ package com.terning.core.designsystem.component.dialog -import androidx.compose.foundation.Image -import androidx.compose.foundation.background -import androidx.compose.foundation.border -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.HorizontalDivider -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties -import com.terning.core.R -import com.terning.core.designsystem.component.button.RoundButton -import com.terning.core.designsystem.theme.CalGreen2 -import com.terning.core.designsystem.theme.Grey200 -import com.terning.core.designsystem.theme.Grey300 -import com.terning.core.designsystem.theme.Grey350 -import com.terning.core.designsystem.theme.Grey500 -import com.terning.core.designsystem.theme.TerningMain -import com.terning.core.designsystem.theme.TerningTheme -import com.terning.core.designsystem.theme.White -import com.terning.core.extension.noRippleClickable @Composable fun TerningDialog( @@ -59,186 +24,6 @@ fun TerningDialog( } } -@Composable -fun DialogContent( - onDismissRequest: () -> Unit, -) { - Box( - modifier = Modifier - .fillMaxWidth() - .wrapContentHeight() - .padding(30.dp) - .background( - color = White, - shape = RoundedCornerShape(20.dp) - ), - ) { - Row( - modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.End - ) { - IconButton(onClick = { onDismissRequest() }, modifier = Modifier.padding(6.dp)) { - Icon( - painter = painterResource(id = R.drawable.ic_dialog_x_32), - contentDescription = null, - tint = Grey300 - ) - } - } - Box( - modifier = Modifier - .fillMaxWidth() - .padding(top = 32.dp), - contentAlignment = Alignment.TopCenter - ) { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 11.dp), - horizontalAlignment = Alignment.CenterHorizontally - ) { - Row( - modifier = Modifier - .width(60.dp) - .height(60.dp) - .border( - width = 1.dp, - color = TerningMain, - shape = RoundedCornerShape(size = 15.dp) - ) - ) { - Image( - painter = painterResource( - id = R.drawable.ic_character1 - ), - modifier = Modifier - .fillMaxWidth() - .background( - Grey200, - shape = RoundedCornerShape(size = 15.dp) - ), - contentDescription = null, - contentScale = ContentScale.Fit, - alignment = Alignment.Center - ) - } - Text( - text = "[한양대학교 컬렉티브임팩트센터] /코이카 영프로페셔널(YP) 모집합니다", - textAlign = TextAlign.Center, - style = TerningTheme.typography.title4, - color = Grey500, - modifier = Modifier.padding(top = 20.dp) - ) - Text( - text = "공고를 캘린더에 스크랩하시겠어요?", - style = TerningTheme.typography.body5, - color = Grey350, - modifier = Modifier.padding( - top = 4.dp, - bottom = 13.dp - ) - ) - Column( - horizontalAlignment = Alignment.Start, - verticalArrangement = Arrangement.Top, - modifier = Modifier - .fillMaxWidth() - .padding(horizontal = 13.dp) - ) { - Row( - modifier = Modifier - .background( - color = CalGreen2, - shape = RoundedCornerShape(14.dp) - ) - .noRippleClickable { }, - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.Start - ) { - Icon( - painter = painterResource(id = R.drawable.ic_down_22), - contentDescription = stringResource( - id = R.string.dialog_content_color_button - ), - tint = White, - modifier = Modifier.padding( - start = 7.dp, - top = 2.dp, - bottom = 2.dp - ) - ) - Text( - text = stringResource(id = R.string.dialog_content_color_button), - style = TerningTheme.typography.body5, - color = White, - modifier = Modifier.padding(end = 13.dp) - ) - } - HorizontalDivider( - thickness = 1.dp, - color = Grey200, - modifier = Modifier.padding( - top = 11.dp, - bottom = 8.dp - ) - ) - Text( - text = "D-3", - style = TerningTheme.typography.body5, - color = TerningMain, - modifier = Modifier.padding(bottom = 9.dp) - ) - Column( - modifier = Modifier.padding( - bottom = 29.dp - ), - verticalArrangement = Arrangement.spacedBy( - 5.dp, - Alignment.CenterVertically - ), - horizontalAlignment = Alignment.Start, - ) { - listOf( - "서류 마감" to "2024년 7월 23일", - "근무 기간" to "2개월", - "근무 시작" to "2024년 8월" - ).forEach { (title, value) -> - InternInfoRow(title, value) - } - } - } - RoundButton( - style = TerningTheme.typography.button3, - paddingVertical = 12.dp, - cornerRadius = 8.dp, - text = R.string.dialog_scrap_button, - onButtonClick = { /*TODO*/ }, - modifier = Modifier.padding(bottom = 8.dp) - ) - } - } - } -} - -@Composable -fun InternInfoRow(title: String, value: String) { - Row( - horizontalArrangement = Arrangement.spacedBy(12.dp, Alignment.Start), - verticalAlignment = Alignment.Top, - ) { - Text( - text = title, - style = TerningTheme.typography.body2, - color = Grey350, - ) - Text( - text = value, - style = TerningTheme.typography.body3, - color = Grey500, - ) - } -} - @Preview(showBackground = true, showSystemUi = true) @Composable fun TerningDialogPreview() { @@ -246,7 +31,9 @@ fun TerningDialogPreview() { onDismissRequest = {}, content = { DialogContent( - onDismissRequest = {} + onDismissRequest = {}, + isScrapped = false ) - }) + } + ) } \ No newline at end of file diff --git a/core/src/main/res/drawable/ic_up_22.xml b/core/src/main/res/drawable/ic_up_22.xml new file mode 100644 index 000000000..25e166749 --- /dev/null +++ b/core/src/main/res/drawable/ic_up_22.xml @@ -0,0 +1,10 @@ + + + diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index 9beaa15a7..68b733ac2 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -90,7 +90,8 @@ fun SignInScreen( onDismissRequest = { openDialog.value = false }, content = { DialogContent( - onDismissRequest = { openDialog.value = false } + onDismissRequest = { openDialog.value = false }, + isScrapped = false ) } ) From 6bac3baa944aad619fe272edb4c82da80c6f137c Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 18:04:53 +0900 Subject: [PATCH 09/12] =?UTF-8?q?[RENAME/#53]=20=EB=8B=A4=EC=9D=B4?= =?UTF-8?q?=EC=96=BC=EB=A1=9C=EA=B7=B8=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designsystem/component/dialog/ScrapDialogContent.kt | 2 +- .../dialog/{TerningDialog.kt => TerningBasicDialog.kt} | 8 ++++---- .../com/terning/feature/onboarding/signin/SignInRoute.kt | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) rename core/src/main/java/com/terning/core/designsystem/component/dialog/{TerningDialog.kt => TerningBasicDialog.kt} (88%) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt index d50fce77f..ba8634165 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt @@ -43,7 +43,7 @@ import com.terning.core.extension.noRippleClickable @Composable -fun DialogContent( +fun ScrapDialogContent( onDismissRequest: () -> Unit, isScrapped: Boolean, ) { diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt similarity index 88% rename from core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt rename to core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt index 8f6c05a46..9afda7354 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningDialog.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt @@ -6,7 +6,7 @@ import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties @Composable -fun TerningDialog( +fun TerningBasicDialog( onDismissRequest: () -> Unit, properties: DialogProperties = DialogProperties( usePlatformDefaultWidth = false, @@ -26,11 +26,11 @@ fun TerningDialog( @Preview(showBackground = true, showSystemUi = true) @Composable -fun TerningDialogPreview() { - TerningDialog( +fun TerningBasicDialogPreview() { + TerningBasicDialog( onDismissRequest = {}, content = { - DialogContent( + ScrapDialogContent( onDismissRequest = {}, isScrapped = false ) diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index 68b733ac2..06b9a1aa9 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -23,8 +23,8 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController -import com.terning.core.designsystem.component.dialog.DialogContent -import com.terning.core.designsystem.component.dialog.TerningDialog +import com.terning.core.designsystem.component.dialog.ScrapDialogContent +import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.extension.toast import com.terning.feature.R @@ -86,10 +86,10 @@ fun SignInScreen( when { openDialog.value -> { - TerningDialog( + TerningBasicDialog( onDismissRequest = { openDialog.value = false }, content = { - DialogContent( + ScrapDialogContent( onDismissRequest = { openDialog.value = false }, isScrapped = false ) From 45e3c59d362b59d7e3d1e1d688664eadc8e989b4 Mon Sep 17 00:00:00 2001 From: arinming Date: Fri, 12 Jul 2024 18:14:57 +0900 Subject: [PATCH 10/12] =?UTF-8?q?[FIX/#53]=20=ED=85=8D=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=20=ED=95=98=EB=93=9C=EC=BD=94=EB=94=A9=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/ScrapDialogContent.kt | 10 +++++----- core/src/main/res/values/strings.xml | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt index ba8634165..b032b2d69 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt @@ -116,7 +116,7 @@ fun ScrapDialogContent( modifier = Modifier.padding(top = 20.dp) ) Text( - text = "공고를 캘린더에 스크랩하시겠어요?", + text = stringResource(id = R.string.dialog_content_scrap_sub_title), style = TerningTheme.typography.body5, color = Grey350, modifier = Modifier.padding( @@ -177,7 +177,7 @@ fun ScrapDialogContent( Text(text = "컬러 팔레트") } else { Text( - text = "D-3", + text = stringResource(id = R.string.intern_item_d_day), style = TerningTheme.typography.body5, color = TerningMain, modifier = Modifier.padding(bottom = 9.dp) @@ -191,9 +191,9 @@ fun ScrapDialogContent( horizontalAlignment = Alignment.Start, ) { listOf( - "서류 마감" to "2024년 7월 23일", - "근무 기간" to "2개월", - "근무 시작" to "2024년 8월" + stringResource(id = R.string.intern_info_d_day) to "2024년 7월 23일", + stringResource(id = R.string.intern_info_working) to "2개월", + stringResource(id = R.string.intern_info_start_date) to "2024년 8월" ).forEach { (title, value) -> InternInfoRow(title, value) } diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 500c405de..dd2adcd9c 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -37,6 +37,12 @@ 저장하기 + 공고를 캘린더에 스크랩하시겠어요? 색상 내 캘린더에 스크랩하기 + + + 서류 마감 + 근무 기간 + 근무 시작 \ No newline at end of file From 95deceba49e636c544cdc6e8559215fd0fe2165d Mon Sep 17 00:00:00 2001 From: arinming Date: Sat, 13 Jul 2024 01:41:04 +0900 Subject: [PATCH 11/12] =?UTF-8?q?[FEAT/#53]=20=EC=BB=AC=EB=9F=AC=20?= =?UTF-8?q?=ED=8C=94=EB=A0=88=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/ScrapDialogContent.kt | 27 +++++++++++--- .../component/item/ColorPalette.kt | 36 +++++++++++-------- 2 files changed, 45 insertions(+), 18 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt index b032b2d69..9e58eaab8 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt @@ -31,7 +31,10 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import com.terning.core.R import com.terning.core.designsystem.component.button.RoundButton +import com.terning.core.designsystem.component.item.ColorPalette +import com.terning.core.designsystem.theme.CalBlue2 import com.terning.core.designsystem.theme.CalGreen2 +import com.terning.core.designsystem.theme.CalRed import com.terning.core.designsystem.theme.Grey200 import com.terning.core.designsystem.theme.Grey300 import com.terning.core.designsystem.theme.Grey350 @@ -48,6 +51,7 @@ fun ScrapDialogContent( isScrapped: Boolean, ) { var isColorChange by remember { mutableStateOf(false) } + var selectedColor by remember { mutableStateOf(CalRed) } Box( modifier = Modifier @@ -63,11 +67,14 @@ fun ScrapDialogContent( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End ) { - IconButton(onClick = { onDismissRequest() }, modifier = Modifier.padding(6.dp)) { + IconButton( + onClick = { onDismissRequest() }, + modifier = Modifier.padding(6.dp) + ) { Icon( painter = painterResource(id = R.drawable.ic_dialog_x_32), contentDescription = null, - tint = Grey300 + tint = Grey300, ) } } @@ -134,7 +141,7 @@ fun ScrapDialogContent( Row( modifier = Modifier .background( - color = CalGreen2, + color = if (selectedColor != CalRed) CalBlue2 else CalGreen2, shape = RoundedCornerShape(14.dp) ) .noRippleClickable { @@ -174,7 +181,19 @@ fun ScrapDialogContent( ) ) if (isColorChange) { - Text(text = "컬러 팔레트") + Box( + modifier = Modifier + .fillMaxWidth() + .padding( + top = 12.dp, + bottom = 23.dp, + ), + contentAlignment = Alignment.Center + ) { + ColorPalette( + initialColor = CalRed, + onColorSelected = { selectedColor = it }) + } } else { Text( text = stringResource(id = R.string.intern_item_d_day), diff --git a/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt b/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt index d263ad91d..663286fa1 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/item/ColorPalette.kt @@ -4,8 +4,13 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.CircleShape import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -27,8 +32,8 @@ import com.terning.core.extension.noRippleClickable @Composable fun ColorPalette( - modifier: Modifier = Modifier, - onColorSelected:(Color) -> Unit = {} + initialColor: Color, + onColorSelected: (Color) -> Unit = {}, ) { val colorList = listOf( CalRed, @@ -43,22 +48,24 @@ fun ColorPalette( CalPink ) + var selectedColor by remember { mutableStateOf(initialColor) } + RadioButtonGroups( - modifier = modifier.size(251.dp, 84.dp), options = colorList, gridCellCount = 5, onOptionSelected = { color -> + selectedColor = color onColorSelected(color) }, - buttonComposable = { - color, isSelected, onOptionSelected -> + buttonComposable = { color, isSelected, onOptionSelected -> ColorButton( color = color, - isSelected = isSelected, - onColorSelected = onOptionSelected) + isSelected = selectedColor == color, + onColorSelected = onOptionSelected + ) }, verticalArrangementSpace = 6.dp, - horizontalArrangementSpace = 14.dp, + horizontalArrangementSpace = 0.dp, ) } @@ -67,13 +74,16 @@ internal fun ColorButton( modifier: Modifier = Modifier, color: Color, isSelected: Boolean, - onColorSelected: (Color) -> Unit + onColorSelected: (Color) -> Unit, ) { - Box(modifier = modifier.size(39.dp)) { + Box(modifier = modifier.wrapContentSize()) { Box( modifier = Modifier .size(39.dp) - .background(shape = CircleShape, color = color) + .background( + shape = CircleShape, + color = color + ) .noRippleClickable { onColorSelected(color) }, @@ -89,10 +99,8 @@ internal fun ColorButton( } } - @Preview(showBackground = true) @Composable fun ColorPalettePreview() { - ColorPalette() + ColorPalette(initialColor = CalRed) } - From b37203d59c018adca9625c9014205e484dea1955 Mon Sep 17 00:00:00 2001 From: arinming Date: Sat, 13 Jul 2024 01:55:52 +0900 Subject: [PATCH 12/12] =?UTF-8?q?[REFACTOR/#53]=20=EB=A6=AC=EB=B7=B0=20?= =?UTF-8?q?=EA=B8=B0=EB=B0=98=20=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/dialog/ScrapDialogContent.kt | 12 +++++----- .../component/dialog/TerningBasicDialog.kt | 3 ++- .../feature/onboarding/signin/SignInRoute.kt | 23 +------------------ 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt index 9e58eaab8..222b11220 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/ScrapDialogContent.kt @@ -49,6 +49,7 @@ import com.terning.core.extension.noRippleClickable fun ScrapDialogContent( onDismissRequest: () -> Unit, isScrapped: Boolean, + internInfoList: List>, ) { var isColorChange by remember { mutableStateOf(false) } var selectedColor by remember { mutableStateOf(CalRed) } @@ -69,12 +70,15 @@ fun ScrapDialogContent( ) { IconButton( onClick = { onDismissRequest() }, - modifier = Modifier.padding(6.dp) + modifier = Modifier + .padding(6.dp) ) { Icon( painter = painterResource(id = R.drawable.ic_dialog_x_32), contentDescription = null, tint = Grey300, + modifier = Modifier + .noRippleClickable { onDismissRequest() } ) } } @@ -209,11 +213,7 @@ fun ScrapDialogContent( ), horizontalAlignment = Alignment.Start, ) { - listOf( - stringResource(id = R.string.intern_info_d_day) to "2024년 7월 23일", - stringResource(id = R.string.intern_info_working) to "2개월", - stringResource(id = R.string.intern_info_start_date) to "2024년 8월" - ).forEach { (title, value) -> + internInfoList.forEach { (title, value) -> InternInfoRow(title, value) } } diff --git a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt index 9afda7354..02cdf1e00 100644 --- a/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt +++ b/core/src/main/java/com/terning/core/designsystem/component/dialog/TerningBasicDialog.kt @@ -32,7 +32,8 @@ fun TerningBasicDialogPreview() { content = { ScrapDialogContent( onDismissRequest = {}, - isScrapped = false + isScrapped = false, + internInfoList = listOf() ) } ) diff --git a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt index 06b9a1aa9..eef3a7100 100644 --- a/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt +++ b/feature/src/main/java/com/terning/feature/onboarding/signin/SignInRoute.kt @@ -9,8 +9,6 @@ import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext @@ -23,8 +21,6 @@ import androidx.lifecycle.compose.LocalLifecycleOwner import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.flowWithLifecycle import androidx.navigation.NavHostController -import com.terning.core.designsystem.component.dialog.ScrapDialogContent -import com.terning.core.designsystem.component.dialog.TerningBasicDialog import com.terning.core.designsystem.theme.TerningPointTheme import com.terning.core.extension.toast import com.terning.feature.R @@ -60,8 +56,6 @@ fun SignInScreen( modifier: Modifier = Modifier, onSignInClick: () -> Unit = {}, ) { - val openDialog = remember { mutableStateOf(false) } - Column( modifier = modifier .wrapContentHeight() @@ -77,26 +71,11 @@ fun SignInScreen( KakaoButton( title = stringResource(id = R.string.sign_in_kakao_button), onSignInClick = { -// onSignInClick() - openDialog.value = true + onSignInClick() }, modifier = modifier.padding(horizontal = 20.dp) ) } - - when { - openDialog.value -> { - TerningBasicDialog( - onDismissRequest = { openDialog.value = false }, - content = { - ScrapDialogContent( - onDismissRequest = { openDialog.value = false }, - isScrapped = false - ) - } - ) - } - } } @Preview(showBackground = true)