From 67c60a157b27992c521057246e4a153c4224eeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Tue, 6 Aug 2024 02:10:31 +0900 Subject: [PATCH 0001/1079] init: HomeScreen, HomeHiltViewModel --- .../main/kotlin/com/materip/matetrip/ui/HomeScreen.kt | 2 ++ .../materip/matetrip/viewModel/HomeHiltViewModel.kt | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/viewModel/HomeHiltViewModel.kt diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt new file mode 100644 index 00000000..81695954 --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt @@ -0,0 +1,2 @@ +package com.materip.matetrip.ui + diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/viewModel/HomeHiltViewModel.kt b/feature-home/src/main/kotlin/com/materip/matetrip/viewModel/HomeHiltViewModel.kt new file mode 100644 index 00000000..26e4c371 --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/viewModel/HomeHiltViewModel.kt @@ -0,0 +1,11 @@ +package com.materip.matetrip.viewModel + +//@HiltViewModel +//class HomeHiltViewModel @Inject constructor( +// private val repository: HomeRepository, +// private val homeUseCase: HomeUseCase, +// private val homeMapper: HomeMapper, +//): ViewModel() { +// // ViewModel implementation +// +//} \ No newline at end of file From 6391108798afdb60dc9525507aeddbbeeab20d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Tue, 6 Aug 2024 19:27:06 +0900 Subject: [PATCH 0002/1079] =?UTF-8?q?chore:=20=EB=84=A4=EB=B9=84=EA=B2=8C?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EC=A2=85=EC=86=8D=EC=84=B1=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 1 + gradle/libs.versions.toml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a256b8ca..745ba004 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -70,6 +70,7 @@ dependencies { //hilt implementation(libs.bundles.hilt.impl) + implementation(libs.androidx.navigation.runtime.ktx) kapt(libs.bundles.hilt.kapt) //kakao diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8b600e71..08917394 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,6 +26,7 @@ hiltViewModel = "1.0.0" hiltNavCompose = "1.0.0" kakao = "2.19.0" datastore = "1.1.1" +navigationRuntimeKtx = "2.7.7" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -67,6 +68,7 @@ kakao-share= { group = "com.kakao.sdk", name="v2-share", version.ref="kakao"} kakao-freind = { group = "com.kakao.sdk", name="v2-friend", version.ref="kakao"} kakao-cert = { group = "com.kakao.sdk", name="v2-cert", version.ref="kakao"} datastore = { group = "androidx.datastore", name="datastore-preferences", version.ref="datastore"} +androidx-navigation-runtime-ktx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "navigationRuntimeKtx" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } From 6116ca089f7601afe67394c99fd71d8e38fd5a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:49:52 +0900 Subject: [PATCH 0003/1079] =?UTF-8?q?init:=20FormScreen=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 동행신청 모집글 화면 --- .../src/main/kotlin/com/materip/matetrip/ui/FormScreen.kt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/ui/FormScreen.kt diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/FormScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/FormScreen.kt new file mode 100644 index 00000000..0432b6b8 --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/FormScreen.kt @@ -0,0 +1,8 @@ +package com.materip.matetrip.ui + +import androidx.compose.runtime.Composable + +@Composable +fun FormScreen() { + // FormScreen implementation +} \ No newline at end of file From d4ca13239c7d206dae0a9c5e0e05f0e9306be933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:50:26 +0900 Subject: [PATCH 0004/1079] =?UTF-8?q?init:=20NotificationScreen=20?= =?UTF-8?q?=EC=84=A0=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 알림 화면 --- .../kotlin/com/materip/matetrip/ui/NotificationScreen.kt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/ui/NotificationScreen.kt diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/NotificationScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/NotificationScreen.kt new file mode 100644 index 00000000..12c5fa13 --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/NotificationScreen.kt @@ -0,0 +1,8 @@ +package com.materip.matetrip.ui + +import androidx.compose.runtime.Composable + +@Composable +fun NotificationScreen() { + // FormScreen implementation +} \ No newline at end of file From 8bf5e855e932517e8debdaa9f91f9dd5602f9025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:50:58 +0900 Subject: [PATCH 0005/1079] =?UTF-8?q?init:=20PostScreen=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 동행모집 글 화면 --- .../src/main/kotlin/com/materip/matetrip/ui/PostScreen.kt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/ui/PostScreen.kt diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/PostScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/PostScreen.kt new file mode 100644 index 00000000..8c3ca5c3 --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/PostScreen.kt @@ -0,0 +1,8 @@ +package com.materip.matetrip.ui + +import androidx.compose.runtime.Composable + +@Composable +fun PostScreen() { + // PostScreen implementation +} \ No newline at end of file From 9b3f33304038dd7866c1c7434b63342fb24e3a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:51:43 +0900 Subject: [PATCH 0006/1079] =?UTF-8?q?init:=20ProfileScreen=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 프로필 화면 --- .../main/kotlin/com/materip/matetrip/ui/ProfileScreen.kt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/ui/ProfileScreen.kt diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/ProfileScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/ProfileScreen.kt new file mode 100644 index 00000000..805204d2 --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/ProfileScreen.kt @@ -0,0 +1,8 @@ +package com.materip.matetrip.ui + +import androidx.compose.runtime.Composable + +@Composable +fun ProfileScreen() { + // FormScreen implementation +} \ No newline at end of file From 28a7f26e4ea4fa25daf844860e3bfc7665d7513a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:52:08 +0900 Subject: [PATCH 0007/1079] =?UTF-8?q?init:=20ReviewScreen=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 동행후기 화면 --- .../main/kotlin/com/materip/matetrip/ui/ReviewScreen.kt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 feature-home/src/main/kotlin/com/materip/matetrip/ui/ReviewScreen.kt diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/ReviewScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/ReviewScreen.kt new file mode 100644 index 00000000..a57673ba --- /dev/null +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/ReviewScreen.kt @@ -0,0 +1,8 @@ +package com.materip.matetrip.ui + +import androidx.compose.runtime.Composable + +@Composable +fun ReviewScreen() { + // FormScreen implementation +} \ No newline at end of file From f51c986f49d7efe5aebdffaae74512d7297ae1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:58:05 +0900 Subject: [PATCH 0008/1079] =?UTF-8?q?feat:=20navigation=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20sealed=20class=20Screen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 다양한 화면을 위한 경로와 아이콘을 포함한 `Screen` sealed class 정의 - 경로를 화면으로 매핑하는 `fromRoute` companion object 함수 구현 - SignIn, OnBoarding, Home, Post, Form, Profile, Notification, Review 화면에 대한 data object 추가 --- .../com/materip/matetrip/navigation/Screen.kt | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 app/src/main/java/com/materip/matetrip/navigation/Screen.kt diff --git a/app/src/main/java/com/materip/matetrip/navigation/Screen.kt b/app/src/main/java/com/materip/matetrip/navigation/Screen.kt new file mode 100644 index 00000000..352229bb --- /dev/null +++ b/app/src/main/java/com/materip/matetrip/navigation/Screen.kt @@ -0,0 +1,33 @@ +package com.materip.matetrip.navigation + +import androidx.annotation.StringRes +import com.materip.matetrip.R +import com.materip.matetrip.icon.Logo +import com.materip.matetrip.icon.Icons + +sealed class Screen(val route: String, @StringRes val resourceId: Int, val icon: Int? = null) { + data object SignIn : Screen("signIn", R.string.sign_in) + data object OnBoarding : Screen("onBoarding", R.string.onboarding, Icons.arrow_back_icon) + data object Home : Screen("home", R.string.home, Logo.splash_icon_02) + data object Post : Screen("post", R.string.post, Icons.arrow_back_icon) + data object Form : Screen("form", R.string.form, Icons.arrow_back_icon) + data object Profile : Screen("profile", R.string.profile, Icons.arrow_back_icon) + data object Notification : Screen("notification", R.string.notification, Icons.arrow_back_icon) + data object Review : Screen("review", R.string.review, Icons.arrow_back_icon) + + companion object { + fun fromRoute(route: String?): Screen { + return when (route) { + SignIn.route -> SignIn + OnBoarding.route -> OnBoarding + Home.route -> Home + Post.route -> Post + Form.route -> Form + Profile.route -> Profile + Notification.route -> Notification + Review.route -> Review + else -> Home + } + } + } +} \ No newline at end of file From 1c09b0408153b7c87b46ad17cce5dbd40171f62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 02:59:05 +0900 Subject: [PATCH 0009/1079] feat: Add navigation route names to string resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 네비게이션 경로 이름을 string 리소스에 추가 - SignIn, Onboarding, Home, Post, Form, Profile, Notification, Review 경로 이름 추가 --- app/src/main/res/values/strings.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2dbfbe2e..4803d2a9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,14 @@ Matetrip - \ No newline at end of file + + + SignIn"> + Onboarding"> + Home + Post + Form + Profile"> + Notification"> + Review"> + + From 5f7674886c6aa79fef86ba55f50806c891e70297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 03:00:04 +0900 Subject: [PATCH 0010/1079] =?UTF-8?q?chore:=20Screen=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EC=9D=84=20=EB=A7=A4=EA=B0=9C=EB=B3=80=EC=88=98=EB=A1=9C=20?= =?UTF-8?q?=EB=B0=9B=EB=8A=94=20MateTripTopAppBar=EB=A5=BC=20=EC=9C=84?= =?UTF-8?q?=ED=95=9C=20app=20=EB=AA=A8=EB=93=88=20=EC=9D=98=EC=A1=B4?= =?UTF-8?q?=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core-designsystem/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/core-designsystem/build.gradle.kts b/core-designsystem/build.gradle.kts index 06fb6a08..a58d889f 100644 --- a/core-designsystem/build.gradle.kts +++ b/core-designsystem/build.gradle.kts @@ -40,6 +40,7 @@ android { dependencies { implementation(project(":core-model")) + implementation((project(":app"))) //coil implementation(libs.bundles.coil) From 6d6f1083a1ba5f7135d7142c465840606b695b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 03:01:17 +0900 Subject: [PATCH 0011/1079] =?UTF-8?q?style:=20object=20=EC=B2=AB=EA=B8=80?= =?UTF-8?q?=EC=9E=90=20=EB=8C=80=EB=AC=B8=EC=9E=90=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - logo.kt -> Logo.kt --- .../main/java/com/materip/matetrip/icon/{logo.kt => Logo.kt} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename core-designsystem/src/main/java/com/materip/matetrip/icon/{logo.kt => Logo.kt} (95%) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/icon/logo.kt b/core-designsystem/src/main/java/com/materip/matetrip/icon/Logo.kt similarity index 95% rename from core-designsystem/src/main/java/com/materip/matetrip/icon/logo.kt rename to core-designsystem/src/main/java/com/materip/matetrip/icon/Logo.kt index 5561d801..0614add8 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/icon/logo.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/icon/Logo.kt @@ -2,7 +2,7 @@ package com.materip.matetrip.icon import com.materip.core_designsystem.R -object logo { +object Logo { val app_icon_24 = R.drawable.logo_24px val app_icon_48 = R.drawable.logo_48px val app_icon_60 = R.drawable.logo_60px From 06e8a6de6af0575ebfb8417c866a8a155755d1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 03:01:49 +0900 Subject: [PATCH 0012/1079] =?UTF-8?q?init:=20HomeScreen=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt b/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt index 81695954..68d40ddc 100644 --- a/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt +++ b/feature-home/src/main/kotlin/com/materip/matetrip/ui/HomeScreen.kt @@ -1,2 +1,8 @@ package com.materip.matetrip.ui +import androidx.compose.runtime.Composable + +@Composable +fun HomeScreen() { + // HomeScreen implementation +} \ No newline at end of file From 63a71a3cca2576378ff4cf3ed68be1b503482262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 03:03:57 +0900 Subject: [PATCH 0013/1079] =?UTF-8?q?feat:=20TopAppBar=20=EC=8B=9C?= =?UTF-8?q?=EA=B7=B8=EB=8B=88=EC=B2=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materip/matetrip/component/TopAppBar.kt | 70 +++++-------------- 1 file changed, 19 insertions(+), 51 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt index 50f02c6e..252da35c 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt @@ -28,6 +28,7 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.materip.matetrip.icon.Icons.notification_icon +import com.materip.matetrip.navigation.Screen import com.materip.matetrip.theme.MateTripTypographySet @@ -38,53 +39,26 @@ import com.materip.matetrip.theme.MateTripTypographySet * nestedScrollConnection: 상단바의 스크롤 동작을 제어하는 객체 */ @Composable -fun MateTripTopAppBar() { - val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState()) - - Scaffold( - modifier = Modifier.nestedScroll(scrollBehavior.nestedScrollConnection), - - topBar = { - TopAppBar( - title = { - Row( - modifier = Modifier - .padding(top = 20.dp, start = 0.dp, bottom = 20.dp), - verticalAlignment = androidx.compose.ui.Alignment.CenterVertically - ) { - Text( - "MATE", - style = MateTripTypographySet.topBarTitle - ) - // 이미지 추가 - Icon( - imageVector = Icons.Filled.Face, // 원하는 이미지로 변경 - contentDescription = "Logo" - ) - Text( - "TRIP", - style = MateTripTypographySet.topBarTitle - ) - } - }, - actions = { - IconButton(onClick = { /* 알림 설정 시 알림을 표시하기 */ }) { - Icon( - painter = painterResource(id = notification_icon), - contentDescription = "Localized description", - tint = Color.Unspecified // 드로어블의 원래 색상을 사용 - ) - } - }, - scrollBehavior = scrollBehavior, - colors = TopAppBarDefaults.topAppBarColors( - containerColor = Color.White +fun MateTripTopAppBar( + currentScreen: Screen, + canNavigateBack: Boolean, + navigateUp: () -> Unit = {}, +) { + TopAppBar( + title = { }, + actions = { + IconButton(onClick = { /* 알림 설정 시 알림을 표시하기 */ }) { + Icon( + painter = painterResource(id = notification_icon), + contentDescription = "Localized description", + tint = Color.Unspecified // 드로어블의 원래 색상을 사용 ) - ) + } }, - ) { innerPadding -> - ScrollContent(innerPadding) - } + colors = TopAppBarDefaults.topAppBarColors( + containerColor = Color.White + ) + ) } @Composable @@ -99,10 +73,4 @@ fun ScrollContent(innerPadding: PaddingValues) { ) { // 여기에 스크롤 가능한 컨텐츠를 추가 } -} - -@Preview(showBackground = true) -@Composable -fun PreviewMateTripTopAppBar() { - MateTripTopAppBar() } \ No newline at end of file From 47fc4607f2da4cc1f770a36fb2adb490c9eff787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Wed, 7 Aug 2024 03:22:52 +0900 Subject: [PATCH 0014/1079] =?UTF-8?q?feat:=20SetUpNavGraph=20=EC=8B=9C?= =?UTF-8?q?=EA=B7=B8=EB=8B=88=EC=B2=98=20=EC=88=98=EC=A0=95,=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EB=84=A4=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Scaffold를 사용하여 topBar와 bottomBar를 포함한 전체 레이아웃을 구성 - NavHost 내에서 각 화면에 대한 composable을 정의, 각 화면은 별도의 Composable 함수로 구현 - TopAppBar, NavigationBar 구현 중 - Circular dependency 문제로 디자인시스템에서 app 의존성 삭제 - 공통 레이아웃(상단바, 하단바)을 모든 화면에서 재사용 - Screen sealed class를 사용하여 타입 안정성을 보장하고 오류를 방지 - 네비게이션 로직이 중앙화되어 관리가 용이 --- .../java/com/materip/matetrip/MainActivity.kt | 13 +--- .../materip/matetrip/navigation/NavHost.kt | 74 +++++++++++++++++-- core-designsystem/build.gradle.kts | 1 - .../materip/matetrip/component/TopAppBar.kt | 31 ++++---- 4 files changed, 84 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/com/materip/matetrip/MainActivity.kt b/app/src/main/java/com/materip/matetrip/MainActivity.kt index 532f8fe3..8b1246b8 100644 --- a/app/src/main/java/com/materip/matetrip/MainActivity.kt +++ b/app/src/main/java/com/materip/matetrip/MainActivity.kt @@ -4,13 +4,6 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding -import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.tooling.preview.Preview import androidx.navigation.compose.rememberNavController import com.materip.matetrip.navigation.SetUpNavGraph import com.materip.matetrip.ui.theme.MatetripTheme @@ -22,11 +15,7 @@ class MainActivity : ComponentActivity() { setContent { MatetripTheme { val navHost = rememberNavController() - - SetUpNavGraph( - navController = navHost, - startDestination = "TMP_ROUTE" - ) + SetUpNavGraph(navHost) } } } diff --git a/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt b/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt index 73f64366..07e85801 100644 --- a/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt +++ b/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt @@ -1,18 +1,80 @@ package com.materip.matetrip.navigation +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.currentBackStackEntryAsState +import com.materip.matetrip.component.MateTripTopAppBar +import com.materip.matetrip.ui.FormScreen +import com.materip.matetrip.ui.HomeScreen +import com.materip.matetrip.ui.NotificationScreen +import com.materip.matetrip.ui.PostScreen +import com.materip.matetrip.ui.ProfileScreen +import com.materip.matetrip.ui.ReviewScreen @Composable fun SetUpNavGraph( navController: NavHostController, - startDestination: String + startDestination: String = Screen.SignIn.route ) { - NavHost( - navController = navController, - startDestination = startDestination - ){ + val currentBackStack by navController.currentBackStackEntryAsState() + val currentDestination = currentBackStack?.destination + val currentRoute = currentDestination?.route ?: Screen.Home.route + Scaffold( + topBar = { + MateTripTopAppBar( +// currentRoute = currentRoute, +// onNavigateUp = { navController.navigateUp() } + ) + }, + bottomBar = { /* BottomBar() */ } + ) { innerPadding -> + NavHost( + navController = navController, + startDestination = startDestination, + modifier = Modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()) + .padding(innerPadding) + ) { +// composable(Screen.SignIn.route) { +// SignInScreen( +// onSignInSuccess = { navController.navigate(Screen.Home.route) }, +// ) +// } +// composable(Screen.OnBoarding.route) { +// OnBoardingScreen( +// onComplete = { navController.navigate(Screen.Home.route) } +// ) +// } + composable(Screen.Home.route) { + HomeScreen() + } + composable(Screen.Post.route) { + PostScreen() + } + composable(Screen.Form.route) { + FormScreen() + } + composable(Screen.Profile.route) { + ProfileScreen() + } + composable(Screen.Notification.route) { + NotificationScreen() + } + composable(Screen.Review.route) { + ReviewScreen() + } + } } -} \ No newline at end of file +} + diff --git a/core-designsystem/build.gradle.kts b/core-designsystem/build.gradle.kts index a58d889f..06fb6a08 100644 --- a/core-designsystem/build.gradle.kts +++ b/core-designsystem/build.gradle.kts @@ -40,7 +40,6 @@ android { dependencies { implementation(project(":core-model")) - implementation((project(":app"))) //coil implementation(libs.bundles.coil) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt index 252da35c..0cffc4c3 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt @@ -6,30 +6,21 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Face import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton -import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults -import androidx.compose.material3.rememberTopAppBarState import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp import com.materip.matetrip.icon.Icons.notification_icon -import com.materip.matetrip.navigation.Screen -import com.materip.matetrip.theme.MateTripTypographySet +import com.materip.matetrip.icon.Logo.splash_icon_02 +import com.materip.matetrip.theme.Primary /** @@ -40,18 +31,17 @@ import com.materip.matetrip.theme.MateTripTypographySet */ @Composable fun MateTripTopAppBar( - currentScreen: Screen, - canNavigateBack: Boolean, - navigateUp: () -> Unit = {}, +// currentRoute: String, +// onNavigateUp: () -> Unit ) { TopAppBar( - title = { }, + title = { splash_icon_02 }, actions = { IconButton(onClick = { /* 알림 설정 시 알림을 표시하기 */ }) { Icon( painter = painterResource(id = notification_icon), contentDescription = "Localized description", - tint = Color.Unspecified // 드로어블의 원래 색상을 사용 + tint = Primary ) } }, @@ -73,4 +63,13 @@ fun ScrollContent(innerPadding: PaddingValues) { ) { // 여기에 스크롤 가능한 컨텐츠를 추가 } +} + +@Preview +@Composable +fun MateTripTopAppBarPreview() { + MateTripTopAppBar( +// currentRoute = Screen.Home.route, +// onNavigateUp = { } + ) } \ No newline at end of file From 7481d968445ad15f642e48e215755cb8aed35ea0 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:29:14 +0900 Subject: [PATCH 0015/1079] =?UTF-8?q?Feat:=20Modifier=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/matetrip/component/Button.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/Button.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/Button.kt index 1f0fe624..fd479269 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/Button.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/Button.kt @@ -3,6 +3,7 @@ package com.materip.matetrip.component import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.RoundedCornerShape @@ -15,13 +16,13 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.materip.matetrip.theme.MateTripTypographySet -import com.materip.matetrip.theme.ActivatedColor -import com.materip.matetrip.theme.Blue_04 -import com.materip.matetrip.theme.Gray_08 -import com.materip.matetrip.theme.Gray_10 -import com.materip.matetrip.theme.gray_06 -import com.materip.matetrip.theme.InactiveColor -import com.materip.matetrip.theme.Primary +import com.materip.matetrip.theme.MatetripColor.ActivatedColor +import com.materip.matetrip.theme.MatetripColor.Blue_04 +import com.materip.matetrip.theme.MatetripColor.Gray_08 +import com.materip.matetrip.theme.MatetripColor.Gray_10 +import com.materip.matetrip.theme.MatetripColor.InactiveColor +import com.materip.matetrip.theme.MatetripColor.Primary +import com.materip.matetrip.theme.MatetripColor.gray_06 /** * MateTrip Button @@ -30,6 +31,7 @@ import com.materip.matetrip.theme.Primary @Composable fun MateTripButton( + modifier: Modifier = Modifier, onClick: () -> Unit, enabled: Boolean = false, buttonText: String @@ -38,7 +40,7 @@ fun MateTripButton( onClick = onClick, enabled = enabled, shape = RoundedCornerShape(10.dp), - modifier = Modifier.size(width = 300.dp, height = 54.dp), + modifier = modifier.height(height = 54.dp), colors = ButtonDefaults.buttonColors( containerColor = ActivatedColor, contentColor = Color.White, From 577053740a24aeddb0213f132dec55045569b44e Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:29:54 +0900 Subject: [PATCH 0016/1079] =?UTF-8?q?Feat:=20Modifier=20=ED=8C=8C=EB=9D=BC?= =?UTF-8?q?=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/materip/matetrip/component/Card.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt index 10cfc503..4be5a2c5 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt @@ -26,6 +26,7 @@ import com.materip.matetrip.theme.MateTripTypographySet @Composable fun OnboardingElevatedCard( + modifier: Modifier = Modifier, text: String, icon: Int, isSelected: Boolean, // 선택된 카드인지 여부, 이후는 부모 컴포저블에서 관리 @@ -36,9 +37,7 @@ fun OnboardingElevatedCard( Card( colors = CardDefaults.cardColors(containerColor = backgroundColor), - modifier = Modifier - .size(145.dp) - .clickable { onClick() } + modifier = modifier.clickable { onClick() } ) { Column { Text( From 2fd08d726ed59e26be9900a8e95a97b4dc43c355 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:30:10 +0900 Subject: [PATCH 0017/1079] =?UTF-8?q?Design:=20=EC=97=AC=EB=B0=B1=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95=20=EB=B0=8F=20=EB=B9=84=EC=9C=A8=20=EC=A1=B0?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/matetrip/component/Card.kt | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt index 4be5a2c5..e2d14b82 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt @@ -2,9 +2,13 @@ package com.materip.matetrip.component import androidx.compose.foundation.Image import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.aspectRatio +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.Text @@ -39,7 +43,10 @@ fun OnboardingElevatedCard( colors = CardDefaults.cardColors(containerColor = backgroundColor), modifier = modifier.clickable { onClick() } ) { - Column { + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.SpaceBetween + ){ Text( text = text, modifier = Modifier @@ -47,13 +54,17 @@ fun OnboardingElevatedCard( textAlign = TextAlign.Center, style = MateTripTypographySet.onboardingCard.copy(color = textColor), ) - - Image( - painter = painterResource(id = icon), - contentDescription = "$text 아이콘", - modifier = Modifier - .padding(start = 65.dp, top = 20.dp) - ) + Row( + modifier = Modifier.fillMaxWidth().padding(top = 20.dp, end = 16.dp, bottom = 16.dp), + horizontalArrangement = Arrangement.End + ){ + Image( + painter = painterResource(id = icon), + contentDescription = "$text 아이콘", + modifier = Modifier + .padding(start = 65.dp, top = 20.dp) + ) + } } } } @@ -73,10 +84,24 @@ fun OnboardingCardSelectionPreview() { } } - OnboardingElevatedCard( - text = "남성", - icon = man_icon, - isSelected = selectedCards.contains("남성"), - onClick = { toggleSelection("남성") } - ) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier.weight(1f).aspectRatio(1f), + text = "남성", + icon = man_icon, + isSelected = selectedCards.contains("남성"), + onClick = { toggleSelection("남성") } + ) + OnboardingElevatedCard( + modifier = Modifier.weight(1f) + .aspectRatio(1f), + text = "남성", + icon = man_icon, + isSelected = selectedCards.contains("남성"), + onClick = { toggleSelection("남성") } + ) + + } } \ No newline at end of file From 70f07af5c1988e5ae52b97629b92df17e1b7c6cc Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:30:28 +0900 Subject: [PATCH 0018/1079] =?UTF-8?q?Resource:=20Color=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20Object=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/materip/matetrip/theme/Color.kt | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/theme/Color.kt b/core-designsystem/src/main/java/com/materip/matetrip/theme/Color.kt index b99aec49..da03fff4 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/theme/Color.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/theme/Color.kt @@ -5,30 +5,33 @@ import androidx.compose.ui.graphics.Color /** * 메이트립 Android Color */ -// Main Color -internal val Primary = Color(0xFF3553F2) -internal val Blue_01 = Color(0xFF9BA1DA) -internal val Blue_02 = Color(0xFFBEC3EF) -internal val Blue_03 = Color(0xFFDDE1FC) -internal val Blue_04 = Color(0xFFEEF0FF) +object MatetripColor{ -// Button Color -internal val ActivatedColor = Color(0xFF020514) -internal val InactiveColor = Color(0xFFDDDFEA) + // Main Color + val Primary = Color(0xFF3553F2) + val Blue_01 = Color(0xFF9BA1DA) + val Blue_02 = Color(0xFFBEC3EF) + val Blue_03 = Color(0xFFDDE1FC) + val Blue_04 = Color(0xFFEEF0FF) -// Typography Color -internal val Gray_11 = Color(0xFF1C1B1F) -internal val Gray_10 = Color(0xFF313033) -internal val Gray_09 = Color(0xFF484649) -internal val Gray_08 = Color(0xFF605D62) -internal val Gray_07 = Color(0xFF787579) -internal val gray_06 = Color(0xFF939094) -internal val gray_05 = Color(0xFFAEAAAE) -internal val Gray_04 = Color(0xFFCECECE) -internal val Gray_03 = Color(0xFFE9E9E9) -internal val Gray_02 = Color(0xFFF4F4F4) -internal val Gray_01 = Color(0xFFFAFAFA) + // Button Color + val ActivatedColor = Color(0xFF020514) + val InactiveColor = Color(0xFFDDDFEA) -//kakao button -internal val KakaoButtonColor = Color(0xFFF6DB4F) -internal val KakaoTextColor = Color(0xFF382929) \ No newline at end of file + // Typography Color + val Gray_11 = Color(0xFF1C1B1F) + val Gray_10 = Color(0xFF313033) + val Gray_09 = Color(0xFF484649) + val Gray_08 = Color(0xFF605D62) + val Gray_07 = Color(0xFF787579) + val gray_06 = Color(0xFF939094) + val gray_05 = Color(0xFFAEAAAE) + val Gray_04 = Color(0xFFCECECE) + val Gray_03 = Color(0xFFE9E9E9) + val Gray_02 = Color(0xFFF4F4F4) + val Gray_01 = Color(0xFFFAFAFA) + + //kakao button + val KakaoButtonColor = Color(0xFFF6DB4F) + val KakaoTextColor = Color(0xFF382929) +} From 795655a04938aed3324d9dd2a4b4478c07d5b75c Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:30:59 +0900 Subject: [PATCH 0019/1079] =?UTF-8?q?Resource:=20Color=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20Object=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/matetrip/component/KakaoButton.kt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/KakaoButton.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/KakaoButton.kt index d523cdfd..05e73745 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/KakaoButton.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/KakaoButton.kt @@ -2,7 +2,6 @@ package com.materip.matetrip.component import androidx.compose.foundation.Image 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.Spacer @@ -12,29 +11,22 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.icons.filled.AccountCircle import androidx.compose.material3.Button import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.Icon import androidx.compose.material3.Text 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.graphics.Shape import androidx.compose.ui.res.painterResource import androidx.compose.ui.text.font.Font import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import coil.compose.AsyncImagePainter.State.Empty.painter import com.materip.core_designsystem.R -import com.materip.matetrip.icon.Icons -import com.materip.matetrip.theme.KakaoButtonColor -import com.materip.matetrip.theme.KakaoTextColor +import com.materip.matetrip.theme.MatetripColor.KakaoButtonColor +import com.materip.matetrip.theme.MatetripColor.KakaoTextColor @Composable fun KakaoButton( From 20c40af82f8820034cb595763ad6b8decb646e0d Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:31:29 +0900 Subject: [PATCH 0020/1079] =?UTF-8?q?Resource:=20Color=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20Object=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/materip/matetrip/component/ProgressIndicator.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt index 1bf52a35..5c8f8123 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt @@ -19,9 +19,8 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.materip.matetrip.theme.Primary -import com.materip.matetrip.theme.Blue_04 -import kotlinx.coroutines.launch +import com.materip.matetrip.theme.MatetripColor.Blue_04 +import com.materip.matetrip.theme.MatetripColor.Primary /** * ProgressIndicator From ca627f00d806c59e3304d8d388bc50215638f0f5 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:31:53 +0900 Subject: [PATCH 0021/1079] =?UTF-8?q?Resource:=20Color=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20Object=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/materip/matetrip/component/SearchBar.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/SearchBar.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/SearchBar.kt index 531ab034..89ec26c9 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/SearchBar.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/SearchBar.kt @@ -21,7 +21,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.materip.matetrip.theme.gray_06 +import com.materip.matetrip.theme.MatetripColor.gray_06 /** * SearchBar/Container, Leading icon button, Supporting text From ca80d0ed1122155df0b7e8f4cb439435d936316b Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:32:06 +0900 Subject: [PATCH 0022/1079] =?UTF-8?q?Resource:=20Color=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20Object=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/materip/matetrip/component/Tag.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/Tag.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/Tag.kt index 642bf422..de1be9b9 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/Tag.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/Tag.kt @@ -20,9 +20,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.materip.matetrip.theme.Gray_11 import com.materip.matetrip.theme.MateTripTypographySet -import com.materip.matetrip.theme.Primary +import com.materip.matetrip.theme.MatetripColor.Gray_11 +import com.materip.matetrip.theme.MatetripColor.Primary @Composable fun RegionTag( From 3bb1fd09c148456b44321bd9af4569bea9d2db18 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:32:13 +0900 Subject: [PATCH 0023/1079] =?UTF-8?q?Resource:=20Color=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20Object=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/materip/matetrip/theme/Type.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/theme/Type.kt b/core-designsystem/src/main/java/com/materip/matetrip/theme/Type.kt index 8a67dabd..12da0e40 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/theme/Type.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/theme/Type.kt @@ -96,7 +96,7 @@ val MateTripTypographySet = MateTripTypography( fontWeight = FontWeight.W500, fontSize = 14.sp, lineHeight = 20.sp, - color = gray_05 + color = MatetripColor.gray_05 ), homeTag = TextStyle( fontFamily = customFontFamily.notoSansKr, From f6e876c495aac67cb1c676cb493ef7f863e7c49d Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:33:01 +0900 Subject: [PATCH 0024/1079] =?UTF-8?q?Feat:=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20=EB=82=B4=EB=B6=80?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../matetrip/component/ProgressIndicator.kt | 58 ++++++------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt index 5c8f8123..08fde988 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/ProgressIndicator.kt @@ -1,21 +1,11 @@ package com.materip.matetrip.component -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.size import androidx.compose.material3.LinearProgressIndicator import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableFloatStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.rememberCoroutineScope -import androidx.compose.runtime.setValue -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.StrokeCap import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -28,40 +18,26 @@ import com.materip.matetrip.theme.MatetripColor.Primary */ @Composable -fun ProgressIndicator() { - var currentProgress by remember { mutableFloatStateOf(0.25f) } - val scope = rememberCoroutineScope() - - Column( - modifier = Modifier - .background(color = Color.White) - .fillMaxWidth(), - horizontalAlignment = Alignment.CenterHorizontally - ) { - LinearProgressIndicator( - progress = { currentProgress }, - modifier = Modifier.size(width = 300.dp, height = 8.dp), - color = Primary, - trackColor = Blue_04, - strokeCap = StrokeCap.Round, - ) - Spacer(modifier = Modifier.height(40.dp)) - MateTripButton( - onClick = { - scope.launch { - if (currentProgress < 1f) { - currentProgress += 0.25f - } - } - }, - enabled = true, - buttonText = "다음" - ) - } +fun ProgressIndicator( + modifier: Modifier = Modifier, + currentProgress: Float +) { + LinearProgressIndicator( + progress = { currentProgress }, + modifier = modifier.height(8.dp), + color = Primary, + trackColor = Blue_04, + strokeCap = StrokeCap.Round, + ) } @Preview @Composable fun ProgressIndicatorPreview() { - ProgressIndicator() + Column(modifier = Modifier.fillMaxWidth()){ + ProgressIndicator(modifier = Modifier.fillMaxWidth(),currentProgress = 0.25f) + ProgressIndicator(modifier = Modifier.fillMaxWidth(),currentProgress = 0.5f) + ProgressIndicator(modifier = Modifier.fillMaxWidth(),currentProgress = 0.75f) + ProgressIndicator(modifier = Modifier.fillMaxWidth(),currentProgress = 1f) + } } From d5613f4faec1d406d03521049d6072f51717363a Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:34:03 +0900 Subject: [PATCH 0025/1079] =?UTF-8?q?Feat:=20=EC=84=B1=EB=B3=84=20enum=20c?= =?UTF-8?q?lass=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/materip/core_model/ui_model/Gender.kt | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 core-model/src/main/java/com/materip/core_model/ui_model/Gender.kt diff --git a/core-model/src/main/java/com/materip/core_model/ui_model/Gender.kt b/core-model/src/main/java/com/materip/core_model/ui_model/Gender.kt new file mode 100644 index 00000000..32baca91 --- /dev/null +++ b/core-model/src/main/java/com/materip/core_model/ui_model/Gender.kt @@ -0,0 +1,6 @@ +package com.materip.core_model.ui_model + +enum class Gender { + FEMALE, + MALE +} \ No newline at end of file From 09d73f27624c7cbe92a6f7088a613b738d436be0 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:34:29 +0900 Subject: [PATCH 0026/1079] =?UTF-8?q?Resource:=20app=20=EB=A1=9C=EA=B3=A0?= =?UTF-8?q?=20=EC=95=84=EC=9D=B4=EC=BD=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../drawable/ic_app_logo_female_active.xml | 49 +++++++++++++++++++ .../drawable/ic_app_logo_female_inactive.xml | 49 +++++++++++++++++++ .../res/drawable/ic_app_logo_male_active.xml | 35 +++++++++++++ .../drawable/ic_app_logo_male_inactive.xml | 49 +++++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 core-designsystem/src/main/res/drawable/ic_app_logo_female_active.xml create mode 100644 core-designsystem/src/main/res/drawable/ic_app_logo_female_inactive.xml create mode 100644 core-designsystem/src/main/res/drawable/ic_app_logo_male_active.xml create mode 100644 core-designsystem/src/main/res/drawable/ic_app_logo_male_inactive.xml diff --git a/core-designsystem/src/main/res/drawable/ic_app_logo_female_active.xml b/core-designsystem/src/main/res/drawable/ic_app_logo_female_active.xml new file mode 100644 index 00000000..5be07420 --- /dev/null +++ b/core-designsystem/src/main/res/drawable/ic_app_logo_female_active.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + diff --git a/core-designsystem/src/main/res/drawable/ic_app_logo_female_inactive.xml b/core-designsystem/src/main/res/drawable/ic_app_logo_female_inactive.xml new file mode 100644 index 00000000..a57eec28 --- /dev/null +++ b/core-designsystem/src/main/res/drawable/ic_app_logo_female_inactive.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + diff --git a/core-designsystem/src/main/res/drawable/ic_app_logo_male_active.xml b/core-designsystem/src/main/res/drawable/ic_app_logo_male_active.xml new file mode 100644 index 00000000..4ec201a5 --- /dev/null +++ b/core-designsystem/src/main/res/drawable/ic_app_logo_male_active.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + diff --git a/core-designsystem/src/main/res/drawable/ic_app_logo_male_inactive.xml b/core-designsystem/src/main/res/drawable/ic_app_logo_male_inactive.xml new file mode 100644 index 00000000..6ce4dc62 --- /dev/null +++ b/core-designsystem/src/main/res/drawable/ic_app_logo_male_inactive.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + From f11a657ad5d66e4ac51ee1958a05fcd389c2ffdf Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:34:51 +0900 Subject: [PATCH 0027/1079] =?UTF-8?q?Feat:=20Input=20User=20Info=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/InputUserInfoScreen.kt | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/InputUserInfoScreen.kt diff --git a/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/InputUserInfoScreen.kt b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/InputUserInfoScreen.kt new file mode 100644 index 00000000..66f1a6c0 --- /dev/null +++ b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/InputUserInfoScreen.kt @@ -0,0 +1,149 @@ +package com.materip.feature_onboarding.screens + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +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.width +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.Font +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.materip.core_model.ui_model.Gender +import com.materip.core_model.ui_model.InputKeyboardType +import com.materip.matetrip.component.MateTripButton +import com.materip.matetrip.component.OnboardingElevatedCard +import com.materip.matetrip.component.ProgressIndicator +import com.materip.matetrip.component.UnderlinedTextField +import com.materip.matetrip.theme.MateTripTypographySet +import com.materip.matetrip.theme.OnboardingMessage + +@Composable +fun InputUserInfoRoute(){ + +} + +@Composable +fun InputUserInfoScreen( + onNextClick: (birthYear: String, selectedGender: Gender) -> Unit, +){ + var birthYear by remember{mutableStateOf("")} + var selectedGender by remember{mutableStateOf(null)} + var isEnabled = remember{ + derivedStateOf {birthYear.isNotEmpty() && selectedGender != null} + } + Column( + modifier = Modifier + .fillMaxSize() + .background(color = Color.White) + .padding(horizontal = 30.dp) + .padding(bottom = 40.dp) + ){ + Spacer(Modifier.height(10.dp)) + ProgressIndicator( + modifier = Modifier.fillMaxWidth(), + currentProgress = 0.25f + ) + Spacer(Modifier.height(10.dp)) + Spacer(Modifier.height(64.dp)) + Text( + text = OnboardingMessage.MESSAGE_1.title, + fontSize = MateTripTypographySet.onboardingTitle.fontSize, + fontFamily = MateTripTypographySet.onboardingTitle.fontFamily, + fontWeight = MateTripTypographySet.onboardingTitle.fontWeight, + color = MateTripTypographySet.onboardingTitle.color + ) + Spacer(Modifier.height(10.dp)) + Text( + text = OnboardingMessage.MESSAGE_1.message, + fontSize = MateTripTypographySet.onboardingMessage.fontSize, + fontWeight = MateTripTypographySet.onboardingMessage.fontWeight, + fontFamily = MateTripTypographySet.onboardingMessage.fontFamily, + color = MateTripTypographySet.onboardingTitle.color + ) + Spacer(Modifier.height(34.dp)) + Text( + text = "출생연도", + fontSize = 14.sp, + fontFamily = FontFamily(Font(com.materip.core_designsystem.R.font.noto_sans_kr)), + fontWeight = FontWeight(500), + color = Color.Black + ) + Spacer(Modifier.height(2.dp)) + UnderlinedTextField( + modifier = Modifier.fillMaxWidth(), + value = birthYear, + onValueChange = {birthYear = it}, + placeholder = "2024", + fontSize = 18.sp, + fontFamily = FontFamily(Font(com.materip.core_designsystem.R.font.roboto_medium)), + fontWeight = FontWeight(500), + textColor = Color.Black, + underlineColor = Color(0xFF939094), /** gray_06 으로 치환 */ + inputType = InputKeyboardType.NUMBER + ) + Spacer(Modifier.height(30.dp)) + Text( + text = "성별", + fontSize = 14.sp, + fontFamily = FontFamily(Font(com.materip.core_designsystem.R.font.noto_sans_kr)), + fontWeight = FontWeight(500), + color = Color.Black + ) + Spacer(Modifier.height(12.dp)) + Row( + modifier = Modifier.fillMaxWidth(), + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "남성", + icon = if(selectedGender == Gender.MALE) com.materip.core_designsystem.R.drawable.ic_app_logo_male_active else com.materip.core_designsystem.R.drawable.ic_app_logo_male_inactive, + isSelected = selectedGender == Gender.MALE, + onClick = {selectedGender = Gender.MALE} + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "여성", + icon = if(selectedGender == Gender.FEMALE) com.materip.core_designsystem.R.drawable.ic_app_logo_male_active else com.materip.core_designsystem.R.drawable.ic_app_logo_female_inactive, + isSelected = selectedGender == Gender.FEMALE, + onClick = {selectedGender = Gender.FEMALE} + ) + } + Spacer(Modifier.weight(1f)) + MateTripButton( + modifier = Modifier.fillMaxWidth(), + onClick = { onNextClick(birthYear, selectedGender!!) }, + buttonText = "다음", + enabled = isEnabled.value + ) + } +} + +@Preview(showBackground = true) +@Composable +private fun InputUserInfoUiTest(){ + InputUserInfoScreen(onNextClick = {birthYear, selectedGender -> + + }) +} \ No newline at end of file From 2e181b7f8d84ad556ae413a2483216e192f40dff Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:35:06 +0900 Subject: [PATCH 0028/1079] =?UTF-8?q?Feat:=20Keyboard=20Type=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/core_model/ui_model/KeyboardType.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 core-model/src/main/java/com/materip/core_model/ui_model/KeyboardType.kt diff --git a/core-model/src/main/java/com/materip/core_model/ui_model/KeyboardType.kt b/core-model/src/main/java/com/materip/core_model/ui_model/KeyboardType.kt new file mode 100644 index 00000000..ffe4632d --- /dev/null +++ b/core-model/src/main/java/com/materip/core_model/ui_model/KeyboardType.kt @@ -0,0 +1,11 @@ +package com.materip.core_model.ui_model + +enum class InputKeyboardType { + EMAIL, //이메일 + NUMBER, //숫자 + NUMBER_PASSWORD, //숫자 비밀번호 + PASSWORD, //비밀번호 + PHONE, //전화번호 + TEXT, //텍스트 + URI, //URI +} \ No newline at end of file From ba48ec6550a2a28ea94965991cb752ba90000c85 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 16:35:36 +0900 Subject: [PATCH 0029/1079] =?UTF-8?q?Feat:=20underlined=20text=20field=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=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 --- .../matetrip/component/UnderlinedTextField.kt | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 core-designsystem/src/main/java/com/materip/matetrip/component/UnderlinedTextField.kt diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/UnderlinedTextField.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/UnderlinedTextField.kt new file mode 100644 index 00000000..c3c54802 --- /dev/null +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/UnderlinedTextField.kt @@ -0,0 +1,108 @@ +package com.materip.matetrip.component + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.text.BasicTextField +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material3.HorizontalDivider +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.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.Font +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.materip.core_designsystem.R +import com.materip.core_model.ui_model.InputKeyboardType +import com.materip.matetrip.theme.MatetripColor.gray_06 + +@Composable +fun UnderlinedTextField( + modifier: Modifier = Modifier, + value: String, + onValueChange: (newValue: String) -> Unit, + placeholder: String?, + fontSize: TextUnit, + fontFamily: FontFamily, + fontWeight: FontWeight, + textColor: Color, + underlineColor: Color, + inputType: InputKeyboardType = InputKeyboardType.TEXT, +){ + val keyboardType = when(inputType){ + InputKeyboardType.TEXT -> KeyboardType.Text + InputKeyboardType.URI -> KeyboardType.Uri + InputKeyboardType.EMAIL -> KeyboardType.Email + InputKeyboardType.PHONE -> KeyboardType.Phone + InputKeyboardType.PASSWORD -> KeyboardType.Password + InputKeyboardType.NUMBER -> KeyboardType.Number + InputKeyboardType.NUMBER_PASSWORD -> KeyboardType.NumberPassword + } + val textStyle = TextStyle( + fontSize = fontSize, + fontFamily = fontFamily, + fontWeight = fontWeight, + color = textColor + ) + BasicTextField( + modifier = modifier, + value = value, + onValueChange = onValueChange, + singleLine = true, + maxLines = 1, + textStyle = textStyle, + keyboardOptions = KeyboardOptions(keyboardType = keyboardType), + decorationBox = { + Column { + Spacer(Modifier.height(10.dp)) + if(value.isEmpty() && placeholder != null){ + Text( + text = placeholder, + color = gray_06, + style = textStyle + ) + } else { + it() + } + Spacer(Modifier.height(10.dp)) + HorizontalDivider(thickness = 1.dp, color = underlineColor) + } + } + ) +} + +@Preview +@Composable +fun UnderlinedTextFieldText(){ + var string by remember{mutableStateOf("1")} + Column( + modifier = Modifier + .fillMaxSize() + .background(color = Color.White) + ){ + UnderlinedTextField( + value = string, + onValueChange = {string = it}, + placeholder = "2024", + fontSize = 18.sp, + fontFamily = FontFamily(Font(R.font.roboto_medium)), + fontWeight = FontWeight(500), + textColor = Color.Black, + underlineColor = gray_06, + inputType = InputKeyboardType.NUMBER + ) + } +} \ No newline at end of file From 8bab93aed423b55ca8576e21d96890dd1fcb98b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 18:24:16 +0900 Subject: [PATCH 0030/1079] =?UTF-8?q?feat:=20=ED=95=98=EB=82=98=EC=9D=98?= =?UTF-8?q?=20=EC=83=81=EB=8B=A8=EB=B0=94=EB=A5=BC=20=EC=84=B8=EB=B6=84?= =?UTF-8?q?=ED=99=94=ED=95=B4=EC=84=9C=203=EA=B0=9C=EC=9D=98=20=EC=83=81?= =?UTF-8?q?=EB=8B=A8=EB=B0=94=EB=A1=9C=20=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - MateTripTopAppBar는 홈 화면의 상단바로 아이콘과 알림 아이콘이 보임 - BackButtonWithTitleTopAppBar는 스크린 제목을 받아 표시하고 뒤로 가기 버튼이 있고, 조건에 따라 업로드하는 아이콘(게시)가 보이게 함. - BackButtonTopAppBar는 뒤로가기 버튼만 보임 (온보딩에서 쓰임) --- .../materip/matetrip/component/TopAppBar.kt | 124 +++++++++++++++--- 1 file changed, 105 insertions(+), 19 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt index 0cffc4c3..55d4e878 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt @@ -6,20 +6,32 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.text.ClickableText +import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.Text import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults 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.res.painterResource +import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.materip.matetrip.icon.Icons import com.materip.matetrip.icon.Icons.notification_icon import com.materip.matetrip.icon.Logo.splash_icon_02 +import com.materip.matetrip.theme.MateTripTypographySet import com.materip.matetrip.theme.Primary @@ -29,18 +41,26 @@ import com.materip.matetrip.theme.Primary * rememberTopAppBarState: 상단바의 상태를 기억하는 상태 객체 * nestedScrollConnection: 상단바의 스크롤 동작을 제어하는 객체 */ + +// 홈 화면의 상단바 @Composable fun MateTripTopAppBar( -// currentRoute: String, -// onNavigateUp: () -> Unit + onNavigateUp: () -> Unit ) { TopAppBar( - title = { splash_icon_02 }, + title = { + Icon( + painter = painterResource(id = splash_icon_02), + contentDescription = "Home Icon", + modifier = Modifier.size(122.dp, 36.dp), + tint = Color.Unspecified // 투명으로 설정하여 아이콘의 색상을 유지 + ) + }, actions = { IconButton(onClick = { /* 알림 설정 시 알림을 표시하기 */ }) { Icon( painter = painterResource(id = notification_icon), - contentDescription = "Localized description", + contentDescription = "Notifications", tint = Primary ) } @@ -51,25 +71,91 @@ fun MateTripTopAppBar( ) } +// 다른 화면의 상단바 @Composable -fun ScrollContent(innerPadding: PaddingValues) { - Column( - modifier = Modifier - .padding(innerPadding) - .fillMaxSize() - .background(Color.White), - verticalArrangement = Arrangement.Center, - horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally - ) { - // 여기에 스크롤 가능한 컨텐츠를 추가 - } +fun BackButtonWithTitleTopAppBar( + screenTitle: String, + onNavigateUp: () -> Unit +) { + val shouldShowActions = true // 임시 조건식에 따라 액션 버튼을 표시할지 여부를 결정 + + CenterAlignedTopAppBar( + title = { + Text( + text = screenTitle, + style = MateTripTypographySet.headline06 + ) + }, + navigationIcon = { + IconButton(onClick = onNavigateUp) { + Icon( + painter = painterResource(id = Icons.arrow_back_icon), + contentDescription = "뒤로 가기 아이콘", + modifier = Modifier.size(24.dp), + tint = Color.Black + ) + } + }, + actions = { + if (shouldShowActions) { + Row( + modifier = Modifier.padding(end = 16.dp), + ) { + ClickableText( + text = AnnotatedString("게시"), + style = MateTripTypographySet.body04, + onClick = { /* 텍스트 클릭 시 동작 */ } + ) + } + } + }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = Color.White + ) + ) +} + +// 뒤로가기 버튼만 있는 상단바 +@Composable +fun BackButtonTopAppBar(onNavigateUp: () -> Unit) { + TopAppBar( + title = { /* 빈 타이틀을 설정 */ }, + navigationIcon = { + IconButton(onClick = onNavigateUp) { + Icon( + painter = painterResource(id = Icons.arrow_back_icon), + contentDescription = "Back", + modifier = Modifier.size(24.dp), + tint = Color.Black + ) + } + }, + colors = TopAppBarDefaults.topAppBarColors( + containerColor = Color.White + ) + ) } @Preview @Composable fun MateTripTopAppBarPreview() { - MateTripTopAppBar( -// currentRoute = Screen.Home.route, -// onNavigateUp = { } - ) + Column( + modifier = Modifier.fillMaxSize(), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + MateTripTopAppBar( + onNavigateUp = { } + ) + Spacer(modifier = Modifier.size(16.dp)) + BackButtonWithTitleTopAppBar( + screenTitle = "동행 모집하기", + onNavigateUp = { } + ) + Spacer(modifier = Modifier.size(16.dp)) + + BackButtonTopAppBar( + onNavigateUp = { } + ) + } } \ No newline at end of file From ec11809f4b429603c580f461762ced0bf228296c Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 20:19:48 +0900 Subject: [PATCH 0031/1079] =?UTF-8?q?Feat:=20icon=20=ED=81=AC=EA=B8=B0=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=88=20=EB=B0=8F=20=EC=83=89=EC=83=81=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/matetrip/component/Card.kt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt index e2d14b82..dbeb8a99 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/Card.kt @@ -9,8 +9,11 @@ import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults +import androidx.compose.material3.Icon +import androidx.compose.material3.LocalContentColor import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateListOf @@ -20,6 +23,7 @@ import androidx.compose.ui.graphics.Color 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.unit.dp import com.materip.matetrip.icon.Icons.man_icon import com.materip.matetrip.theme.MateTripTypographySet @@ -33,11 +37,14 @@ fun OnboardingElevatedCard( modifier: Modifier = Modifier, text: String, icon: Int, + tint: Color? = null, + iconSize: Dp? = null, isSelected: Boolean, // 선택된 카드인지 여부, 이후는 부모 컴포저블에서 관리 onClick: () -> Unit // 선택된 카드의 상태관리는 부모 컴포저블에서 관리 ) { val backgroundColor = if (isSelected) Color(0xFF3553F2) else Color(0xFFEEF0FF) val textColor = if (isSelected) Color.White else MateTripTypographySet.onboardingCard.color + val iconColor = if(tint == null) LocalContentColor.current else tint Card( colors = CardDefaults.cardColors(containerColor = backgroundColor), @@ -58,11 +65,15 @@ fun OnboardingElevatedCard( modifier = Modifier.fillMaxWidth().padding(top = 20.dp, end = 16.dp, bottom = 16.dp), horizontalArrangement = Arrangement.End ){ - Image( + Icon( + modifier = if(iconSize != null){ + Modifier.size(iconSize) + } else { + Modifier + }, painter = painterResource(id = icon), contentDescription = "$text 아이콘", - modifier = Modifier - .padding(start = 65.dp, top = 20.dp) + tint = iconColor ) } } @@ -91,6 +102,7 @@ fun OnboardingCardSelectionPreview() { modifier = Modifier.weight(1f).aspectRatio(1f), text = "남성", icon = man_icon, + iconSize = 30.dp, isSelected = selectedCards.contains("남성"), onClick = { toggleSelection("남성") } ) From 8b46acee60be66e114c128e63d24332f9392c710 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 20:20:17 +0900 Subject: [PATCH 0032/1079] =?UTF-8?q?Feat:=20=EC=9D=8C=EC=8B=9D=20?= =?UTF-8?q?=EC=84=A0=ED=98=B8=EB=8F=84=20=EB=AA=A8=EB=8D=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materip/core_model/ui_model/FoodPreference.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 core-model/src/main/java/com/materip/core_model/ui_model/FoodPreference.kt diff --git a/core-model/src/main/java/com/materip/core_model/ui_model/FoodPreference.kt b/core-model/src/main/java/com/materip/core_model/ui_model/FoodPreference.kt new file mode 100644 index 00000000..d24fd562 --- /dev/null +++ b/core-model/src/main/java/com/materip/core_model/ui_model/FoodPreference.kt @@ -0,0 +1,12 @@ +package com.materip.core_model.ui_model + +enum class FoodPreference { + MEAT, //육류 + SEAFOOD, //해산물 + RICE, //밥류 + VEGETABLES, //채소 + COFFEE, //커피 + DESSERT, //디저트 + FAST_FOOD, //패스트 푸드 + STREET_FOOD, //스트릿 푸드 +} \ No newline at end of file From 797f889cd835704a9daeaa7550c107555f25d162 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 20:20:43 +0900 Subject: [PATCH 0033/1079] =?UTF-8?q?Feat:=20trip=20interest=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/core_model/ui_model/TripInterest.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 core-model/src/main/java/com/materip/core_model/ui_model/TripInterest.kt diff --git a/core-model/src/main/java/com/materip/core_model/ui_model/TripInterest.kt b/core-model/src/main/java/com/materip/core_model/ui_model/TripInterest.kt new file mode 100644 index 00000000..7f493e63 --- /dev/null +++ b/core-model/src/main/java/com/materip/core_model/ui_model/TripInterest.kt @@ -0,0 +1,12 @@ +package com.materip.core_model.ui_model + +enum class TripInterest { + PLANNED, //계획적 + UNPLANNED, //무계획 + PUBLIC_MONEY, //공금 + DUTCH_PAY, //더치페이 + LOOKING_FOR, //찾아본 곳 + DRAWN_TO, //끌리는 곳 + QUICKLY, //빨리 + LEISURELY, //느긋히 +} \ No newline at end of file From e8194c167f84a322d5a94d71b64a44ec3a98157c Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 20:20:51 +0900 Subject: [PATCH 0034/1079] =?UTF-8?q?Feat:=20trip=20style=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/core_model/ui_model/TripStyle.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 core-model/src/main/java/com/materip/core_model/ui_model/TripStyle.kt diff --git a/core-model/src/main/java/com/materip/core_model/ui_model/TripStyle.kt b/core-model/src/main/java/com/materip/core_model/ui_model/TripStyle.kt new file mode 100644 index 00000000..7eaf4db8 --- /dev/null +++ b/core-model/src/main/java/com/materip/core_model/ui_model/TripStyle.kt @@ -0,0 +1,14 @@ +package com.materip.core_model.ui_model + +enum class TripStyle { + RESTAURANT_TOUR, //맛집 탐방 + CAFE_TOUR, //카페 투어 + LIFE_SHOT, //인생샷 + TOURIST_DESTINATION, //관광지 + ACTIVITY, //액티비티 + HEALING, //힐링 + DRIVE, //드라이브 + PACKAGE_TOUR, //패키지 여행 + SHOPPING, //쇼핑 + CULTURE_AND_ARTS //문화 예술 +} \ No newline at end of file From 2ca2131787e9060974371fd9af64f1a92abd6536 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 20:22:42 +0900 Subject: [PATCH 0035/1079] =?UTF-8?q?Feat:=20select=20trip=20interest=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/SelectTripInterestScreen.kt | 230 ++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt diff --git a/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt new file mode 100644 index 00000000..2b60e1e2 --- /dev/null +++ b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt @@ -0,0 +1,230 @@ +package com.materip.feature_onboarding.screens + +import android.widget.Toast +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +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.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.materip.core_model.ui_model.TripInterest +import com.materip.matetrip.component.MateTripButton +import com.materip.matetrip.component.OnboardingElevatedCard +import com.materip.matetrip.component.ProgressIndicator +import com.materip.matetrip.icon.Badges +import com.materip.matetrip.theme.MateTripTypographySet +import com.materip.matetrip.theme.MatetripColor +import com.materip.matetrip.theme.OnboardingMessage + +@Composable +fun SelectTripInterestRoute( + onBackClick: () -> Unit, +){ + SelectTripInterestScreen( + onBackClick = onBackClick, + onNextClick = {a, b, c,d -> + } + ) +} + +@Composable +fun SelectTripInterestScreen( + onBackClick: () -> Unit, + onNextClick: (TripInterest, TripInterest, TripInterest, TripInterest) -> Unit, +){ + val scrollState = rememberScrollState() + var planned by remember{mutableStateOf(null)} + var money by remember{mutableStateOf(null)} + var place by remember{mutableStateOf(null)} + var speed by remember{mutableStateOf(null)} + var isEnabled = remember{derivedStateOf{planned != null && money != null && place != null && speed != null}} + Column( + modifier = Modifier + .fillMaxSize() + .background(color = Color.White) + .padding(horizontal = 30.dp) + .padding(bottom = 40.dp) + ) { + Spacer(Modifier.height(10.dp)) + ProgressIndicator( + modifier = Modifier.fillMaxWidth(), + currentProgress = 0.5f + ) + Spacer(Modifier.height(10.dp)) + Spacer(Modifier.height(20.dp)) + IconButton( + modifier = Modifier.size(24.dp), + onClick = onBackClick + ){ + Icon( + modifier = Modifier.fillMaxSize(), + painter = painterResource(com.materip.core_designsystem.R.drawable.arrow_back_24px), + contentDescription = "Back Button" + ) + } + Spacer(Modifier.height(20.dp)) + Column( + modifier = Modifier.weight(1f).verticalScroll(state = scrollState) + ){ + Text( + text = OnboardingMessage.MESSAGE_2.title, + style = MateTripTypographySet.onboardingTitle + ) + Spacer(Modifier.height(10.dp)) + Text( + text = OnboardingMessage.MESSAGE_2.message, + style = MateTripTypographySet.onboardingMessage + ) + Spacer(Modifier.height(40.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "계획적", + icon = Badges.planned_badge, + iconSize = 30.dp, + isSelected = planned == TripInterest.PLANNED, + tint = if(planned == TripInterest.PLANNED) Color.White else MatetripColor.Blue_01, + onClick = {planned = TripInterest.PLANNED} + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "무계획", + icon = Badges.unplanned_badge, + iconSize = 30.dp, + isSelected = planned == TripInterest.UNPLANNED, + tint = if(planned == TripInterest.UNPLANNED) Color.White else MatetripColor.Blue_01, + onClick = {planned = TripInterest.UNPLANNED} + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "공금", + icon = Badges.public_funds_badge, + iconSize = 30.dp, + isSelected = money == TripInterest.PUBLIC_MONEY, + tint = if(money == TripInterest.PUBLIC_MONEY) Color.White else MatetripColor.Blue_01, + onClick = {money = TripInterest.PUBLIC_MONEY} + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "더치페이", + icon = Badges.dutch_pay_badge, + iconSize = 30.dp, + isSelected = money == TripInterest.DUTCH_PAY, + tint = if(money == TripInterest.DUTCH_PAY) Color.White else MatetripColor.Blue_01, + onClick = {money = TripInterest.DUTCH_PAY} + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "찾아본 곳", + icon = Badges.place_badge, + iconSize = 30.dp, + isSelected = place == TripInterest.LOOKING_FOR, + tint = if(place == TripInterest.LOOKING_FOR) Color.White else MatetripColor.Blue_01, + onClick = {place = TripInterest.LOOKING_FOR} + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "끌리는 곳", + icon = Badges.attractive_badge, + iconSize = 30.dp, + isSelected = place == TripInterest.DRAWN_TO, + tint = if(place == TripInterest.DRAWN_TO) Color.White else MatetripColor.Blue_01, + onClick = {place = TripInterest.DRAWN_TO} + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "빨리빨리", + icon = Badges.rush_badge, + iconSize = 30.dp, + isSelected = speed == TripInterest.QUICKLY, + tint = if(speed == TripInterest.QUICKLY) Color.White else MatetripColor.Blue_01, + onClick = {speed = TripInterest.QUICKLY} + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "느긋하게", + icon = Badges.leisurely_badge, + iconSize = 30.dp, + isSelected = speed == TripInterest.LEISURELY, + tint = if(speed == TripInterest.LEISURELY) Color.White else MatetripColor.Blue_01, + onClick = {speed = TripInterest.LEISURELY} + ) + } + } + Spacer(Modifier.height(10.dp)) + MateTripButton( + modifier = Modifier.fillMaxWidth(), + onClick = { onNextClick(planned!!, money!!, place!!, speed!!) }, + buttonText = "다음" , + enabled = isEnabled.value + ) + } +} + +@Preview(showBackground = true) +@Composable +private fun SelectTripInterestUITest(){ + val context = LocalContext.current + SelectTripInterestScreen(onBackClick = {}, onNextClick = {planned, money, place, speed -> + Toast.makeText(context, "${planned} / ${money} / ${place} / ${speed}", Toast.LENGTH_LONG).show() + }) +} \ No newline at end of file From 936af8618a3d906a874fd9e2f62076c8d90d45c2 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 21:59:52 +0900 Subject: [PATCH 0036/1079] =?UTF-8?q?Design:=20icon=20=ED=81=AC=EA=B8=B0?= =?UTF-8?q?=20=EC=A1=B0=EC=A0=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/SelectTripInterestScreen.kt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt index 2b60e1e2..1455b75e 100644 --- a/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt +++ b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripInterestScreen.kt @@ -107,7 +107,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "계획적", icon = Badges.planned_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = planned == TripInterest.PLANNED, tint = if(planned == TripInterest.PLANNED) Color.White else MatetripColor.Blue_01, onClick = {planned = TripInterest.PLANNED} @@ -119,7 +119,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "무계획", icon = Badges.unplanned_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = planned == TripInterest.UNPLANNED, tint = if(planned == TripInterest.UNPLANNED) Color.White else MatetripColor.Blue_01, onClick = {planned = TripInterest.UNPLANNED} @@ -135,7 +135,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "공금", icon = Badges.public_funds_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = money == TripInterest.PUBLIC_MONEY, tint = if(money == TripInterest.PUBLIC_MONEY) Color.White else MatetripColor.Blue_01, onClick = {money = TripInterest.PUBLIC_MONEY} @@ -147,7 +147,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "더치페이", icon = Badges.dutch_pay_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = money == TripInterest.DUTCH_PAY, tint = if(money == TripInterest.DUTCH_PAY) Color.White else MatetripColor.Blue_01, onClick = {money = TripInterest.DUTCH_PAY} @@ -163,7 +163,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "찾아본 곳", icon = Badges.place_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = place == TripInterest.LOOKING_FOR, tint = if(place == TripInterest.LOOKING_FOR) Color.White else MatetripColor.Blue_01, onClick = {place = TripInterest.LOOKING_FOR} @@ -175,7 +175,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "끌리는 곳", icon = Badges.attractive_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = place == TripInterest.DRAWN_TO, tint = if(place == TripInterest.DRAWN_TO) Color.White else MatetripColor.Blue_01, onClick = {place = TripInterest.DRAWN_TO} @@ -191,7 +191,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "빨리빨리", icon = Badges.rush_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = speed == TripInterest.QUICKLY, tint = if(speed == TripInterest.QUICKLY) Color.White else MatetripColor.Blue_01, onClick = {speed = TripInterest.QUICKLY} @@ -203,7 +203,7 @@ fun SelectTripInterestScreen( .aspectRatio(1f), text = "느긋하게", icon = Badges.leisurely_badge, - iconSize = 30.dp, + iconSize = 48.dp, isSelected = speed == TripInterest.LEISURELY, tint = if(speed == TripInterest.LEISURELY) Color.White else MatetripColor.Blue_01, onClick = {speed = TripInterest.LEISURELY} From c9b79143457d9332afad88238238f58edc3b7301 Mon Sep 17 00:00:00 2001 From: uselessNaming Date: Thu, 8 Aug 2024 22:00:12 +0900 Subject: [PATCH 0037/1079] =?UTF-8?q?Feat:=20select=20trip=20style=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screens/SelectTripStyleScreen.kt | 313 ++++++++++++++++++ 1 file changed, 313 insertions(+) create mode 100644 feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripStyleScreen.kt diff --git a/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripStyleScreen.kt b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripStyleScreen.kt new file mode 100644 index 00000000..73c68983 --- /dev/null +++ b/feature-onboarding/src/main/java/com/materip/feature_onboarding/screens/SelectTripStyleScreen.kt @@ -0,0 +1,313 @@ +package com.materip.feature_onboarding.screens + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.aspectRatio +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.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.mutableStateListOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.snapshots.SnapshotStateList +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.materip.core_designsystem.R +import com.materip.core_model.ui_model.TripInterest +import com.materip.core_model.ui_model.TripStyle +import com.materip.matetrip.component.MateTripButton +import com.materip.matetrip.component.OnboardingElevatedCard +import com.materip.matetrip.component.ProgressIndicator +import com.materip.matetrip.icon.Badges +import com.materip.matetrip.theme.MateTripTypographySet +import com.materip.matetrip.theme.MatetripColor +import com.materip.matetrip.theme.OnboardingMessage + +@Composable +fun SelectTripStyleRoute( + onBackClick: () -> Unit +){ + SelectTripStyleScreen( + onBackClick = onBackClick, + onNextClick = { + + } + ) +} + +@Composable +fun SelectTripStyleScreen( + onBackClick: () -> Unit, + onNextClick: (List) -> Unit, +){ + val scrollState = rememberScrollState() + val styles = remember{ mutableStateListOf() } + var isEnabled = remember{derivedStateOf{styles.isNotEmpty()}} + Column( + modifier = Modifier + .fillMaxSize() + .background(color = Color.White) + .padding(horizontal = 30.dp) + .padding(bottom = 40.dp) + ) { + Spacer(Modifier.height(10.dp)) + ProgressIndicator( + modifier = Modifier.fillMaxWidth(), + currentProgress = 0.75f + ) + Spacer(Modifier.height(10.dp)) + Spacer(Modifier.height(20.dp)) + IconButton( + modifier = Modifier.size(24.dp), + onClick = onBackClick + ){ + Icon( + modifier = Modifier.fillMaxSize(), + painter = painterResource(R.drawable.arrow_back_24px), + contentDescription = "Back Button" + ) + } + Spacer(Modifier.height(20.dp)) + Column( + modifier = Modifier + .weight(1f) + .verticalScroll(state = scrollState) + ){ + Text( + text = OnboardingMessage.MESSAGE_3.title, + style = MateTripTypographySet.onboardingTitle + ) + Spacer(Modifier.height(10.dp)) + Text( + text = OnboardingMessage.MESSAGE_3.message, + style = MateTripTypographySet.onboardingMessage + ) + Spacer(Modifier.height(40.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "맛집탐방", + icon = Badges.restaurant_badge, + iconSize = 48.dp, + isSelected = TripStyle.RESTAURANT_TOUR in styles, + tint = if(TripStyle.RESTAURANT_TOUR in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.RESTAURANT_TOUR in styles){ + styles.remove(TripStyle.RESTAURANT_TOUR) + } else { + styles.add(TripStyle.RESTAURANT_TOUR) + } + } + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "카페투어", + icon = Badges.cafe_tour_badge, + iconSize = 48.dp, + isSelected = TripStyle.CAFE_TOUR in styles, + tint = if(TripStyle.CAFE_TOUR in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.CAFE_TOUR in styles){ + styles.remove(TripStyle.CAFE_TOUR) + } else { + styles.add(TripStyle.CAFE_TOUR) + } + } + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "인생샷", + icon = Badges.image_badge, + iconSize = 48.dp, + isSelected = TripStyle.LIFE_SHOT in styles, + tint = if(TripStyle.LIFE_SHOT in styles) Color.White else MatetripColor.Blue_01, + onClick = {styles.add(TripStyle.LIFE_SHOT)} + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "관광지", + icon = Badges.tourist_badge, + iconSize = 48.dp, + isSelected = TripStyle.TOURIST_DESTINATION in styles, + tint = if(TripStyle.TOURIST_DESTINATION in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.TOURIST_DESTINATION in styles){ + styles.remove(TripStyle.TOURIST_DESTINATION) + } else { + styles.add(TripStyle.TOURIST_DESTINATION) + } + } + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "액티비티", + icon = Badges.activity_badge, + iconSize = 48.dp, + isSelected = TripStyle.ACTIVITY in styles, + tint = if(TripStyle.ACTIVITY in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.ACTIVITY in styles){ + styles.remove(TripStyle.ACTIVITY) + } else { + styles.add(TripStyle.ACTIVITY) + } + } + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "힐링", + icon = Badges.healing_badge, + iconSize = 48.dp, + isSelected = TripStyle.HEALING in styles, + tint = if(TripStyle.HEALING in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.HEALING in styles){ + styles.remove(TripStyle.HEALING) + } else { + styles.add(TripStyle.HEALING) + } + } + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "드라이브", + icon = Badges.drive_badge, + iconSize = 48.dp, + isSelected = TripStyle.DRIVE in styles, + tint = if(TripStyle.DRIVE in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.DRIVE in styles) { + styles.remove(TripStyle.DRIVE) + } else { + styles.add(TripStyle.DRIVE) + } + } + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "패키지 여행", + icon = Badges.package_badge, + iconSize = 48.dp, + isSelected = TripStyle.PACKAGE_TOUR in styles, + tint = if(TripStyle.PACKAGE_TOUR in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.PACKAGE_TOUR in styles){ + styles.remove(TripStyle.PACKAGE_TOUR) + } else { + styles.add(TripStyle.PACKAGE_TOUR) + } + } + ) + } + Spacer(Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxWidth() + ){ + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "쇼핑", + icon = Badges.shopping_badge, + iconSize = 48.dp, + isSelected = TripStyle.SHOPPING in styles, + tint = if(TripStyle.SHOPPING in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.SHOPPING in styles) { + styles.remove(TripStyle.SHOPPING) + } else { + styles.add(TripStyle.SHOPPING) + } + } + ) + Spacer(Modifier.width(10.dp)) + OnboardingElevatedCard( + modifier = Modifier + .weight(1f) + .aspectRatio(1f), + text = "문화예술", + icon = Badges.art_badge, + iconSize = 48.dp, + isSelected = TripStyle.CULTURE_AND_ARTS in styles, + tint = if(TripStyle.CULTURE_AND_ARTS in styles) Color.White else MatetripColor.Blue_01, + onClick = { + if(TripStyle.CULTURE_AND_ARTS in styles) { + styles.remove(TripStyle.CULTURE_AND_ARTS) + } else { + styles.add(TripStyle.CULTURE_AND_ARTS) + } + } + ) + } + } + Spacer(Modifier.height(10.dp)) + MateTripButton( + modifier = Modifier.fillMaxWidth(), + onClick = { onNextClick(styles) }, + buttonText = "다음" , + enabled = isEnabled.value + ) + } +} + +@Preview(showBackground = true) +@Composable +fun SelectTripStyleUITest(){ + SelectTripStyleScreen( + onBackClick = {}, + onNextClick = { + + } + ) +} \ No newline at end of file From 275dce78c72898e3224fad866fcc966be7ab60ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:10:13 +0900 Subject: [PATCH 0038/1079] =?UTF-8?q?feat:=20TopAppBar=20=ED=95=84?= =?UTF-8?q?=EC=9A=94=20=EC=97=86=EB=8A=94=20=ED=8C=8C=EB=9D=BC=EB=AF=B8?= =?UTF-8?q?=ED=84=B0=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/materip/matetrip/component/TopAppBar.kt | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt index 55d4e878..862fd094 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/TopAppBar.kt @@ -2,16 +2,13 @@ package com.materip.matetrip.component -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.ClickableText import androidx.compose.material3.CenterAlignedTopAppBar import androidx.compose.material3.ExperimentalMaterial3Api @@ -44,9 +41,7 @@ import com.materip.matetrip.theme.Primary // 홈 화면의 상단바 @Composable -fun MateTripTopAppBar( - onNavigateUp: () -> Unit -) { +fun MateTripTopAppBar() { TopAppBar( title = { Icon( @@ -144,9 +139,7 @@ fun MateTripTopAppBarPreview() { verticalArrangement = Arrangement.Center, horizontalAlignment = Alignment.CenterHorizontally ) { - MateTripTopAppBar( - onNavigateUp = { } - ) + MateTripTopAppBar() Spacer(modifier = Modifier.size(16.dp)) BackButtonWithTitleTopAppBar( screenTitle = "동행 모집하기", From 12d72e4a4acc88aff945a823f6f7166fdea9a7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:10:35 +0900 Subject: [PATCH 0039/1079] =?UTF-8?q?feat:=20=EB=AC=B8=EC=9E=90=EC=97=B4?= =?UTF-8?q?=20=EB=A6=AC=EC=86=8C=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/values/strings.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4803d2a9..35c71f0a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -10,5 +10,7 @@ Profile"> Notification"> Review"> + Setting"> + MyPage"> From cb6ccabaf4fed7027be425ce69ed1131ee1b783f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:12:35 +0900 Subject: [PATCH 0040/1079] =?UTF-8?q?feat:=20=EB=A7=88=EC=9D=B4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80,=20=EC=84=A4=EC=A0=95=20=EA=B2=BD=EB=A1=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/materip/matetrip/navigation/Screen.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/materip/matetrip/navigation/Screen.kt b/app/src/main/java/com/materip/matetrip/navigation/Screen.kt index 352229bb..5e787399 100644 --- a/app/src/main/java/com/materip/matetrip/navigation/Screen.kt +++ b/app/src/main/java/com/materip/matetrip/navigation/Screen.kt @@ -6,7 +6,7 @@ import com.materip.matetrip.icon.Logo import com.materip.matetrip.icon.Icons sealed class Screen(val route: String, @StringRes val resourceId: Int, val icon: Int? = null) { - data object SignIn : Screen("signIn", R.string.sign_in) + data object SignIn : Screen("sign_in", R.string.sign_in) data object OnBoarding : Screen("onBoarding", R.string.onboarding, Icons.arrow_back_icon) data object Home : Screen("home", R.string.home, Logo.splash_icon_02) data object Post : Screen("post", R.string.post, Icons.arrow_back_icon) @@ -14,6 +14,8 @@ sealed class Screen(val route: String, @StringRes val resourceId: Int, val icon: data object Profile : Screen("profile", R.string.profile, Icons.arrow_back_icon) data object Notification : Screen("notification", R.string.notification, Icons.arrow_back_icon) data object Review : Screen("review", R.string.review, Icons.arrow_back_icon) + data object MyPage : Screen("myPage", R.string.my_page, Icons.arrow_back_icon) + data object Setting : Screen("setting", R.string.setting, Icons.arrow_back_icon) companion object { fun fromRoute(route: String?): Screen { @@ -26,6 +28,8 @@ sealed class Screen(val route: String, @StringRes val resourceId: Int, val icon: Profile.route -> Profile Notification.route -> Notification Review.route -> Review + MyPage.route -> MyPage + Setting.route -> Setting else -> Home } } From 57ba0ad97789129477a88c47aafb9741ad427972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:13:16 +0900 Subject: [PATCH 0041/1079] =?UTF-8?q?style:=20=EB=84=A4=EB=B9=84=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=A1=9C=EC=A7=81=EB=A7=8C=20=EB=82=A8?= =?UTF-8?q?=EA=B2=A8=EB=91=90=EA=B3=A0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materip/matetrip/navigation/NavHost.kt | 94 +++++++++---------- 1 file changed, 42 insertions(+), 52 deletions(-) diff --git a/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt b/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt index 07e85801..72b31252 100644 --- a/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt +++ b/app/src/main/java/com/materip/matetrip/navigation/NavHost.kt @@ -1,17 +1,15 @@ package com.materip.matetrip.navigation import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.Scaffold import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost import androidx.navigation.compose.composable -import androidx.navigation.compose.currentBackStackEntryAsState +import com.materip.matetrip.component.BackButtonTopAppBar +import com.materip.matetrip.component.BackButtonWithTitleTopAppBar import com.materip.matetrip.component.MateTripTopAppBar import com.materip.matetrip.ui.FormScreen import com.materip.matetrip.ui.HomeScreen @@ -23,57 +21,49 @@ import com.materip.matetrip.ui.ReviewScreen @Composable fun SetUpNavGraph( navController: NavHostController, - startDestination: String = Screen.SignIn.route + modifier: Modifier = Modifier, + startDestination: String = Screen.Home.route ) { - val currentBackStack by navController.currentBackStackEntryAsState() - val currentDestination = currentBackStack?.destination - val currentRoute = currentDestination?.route ?: Screen.Home.route + NavHost( + navController = navController, + startDestination = startDestination, + modifier = modifier + .fillMaxSize() + .verticalScroll(rememberScrollState()) + ) { + composable(Screen.Home.route) { + HomeScreen() + } + composable(Screen.Post.route) { + PostScreen() + } + composable(Screen.Form.route) { + FormScreen() + } + composable(Screen.Profile.route) { + ProfileScreen() + } + composable(Screen.Notification.route) { + NotificationScreen() + } + composable(Screen.Review.route) { + ReviewScreen() + } + } +} - Scaffold( - topBar = { - MateTripTopAppBar( -// currentRoute = currentRoute, -// onNavigateUp = { navController.navigateUp() } +@Composable +fun GetTopBar(currentRoute: String?, navController: NavHostController) { + when (currentRoute) { + Screen.Home.route -> { MateTripTopAppBar() } + Screen.OnBoarding.route -> { + BackButtonTopAppBar(onNavigateUp = { navController.navigateUp() } ) + } + else -> { + BackButtonWithTitleTopAppBar( + screenTitle = "동행 모집하기", + onNavigateUp = { navController.navigateUp() } ) - }, - bottomBar = { /* BottomBar() */ } - ) { innerPadding -> - NavHost( - navController = navController, - startDestination = startDestination, - modifier = Modifier - .fillMaxSize() - .verticalScroll(rememberScrollState()) - .padding(innerPadding) - ) { -// composable(Screen.SignIn.route) { -// SignInScreen( -// onSignInSuccess = { navController.navigate(Screen.Home.route) }, -// ) -// } -// composable(Screen.OnBoarding.route) { -// OnBoardingScreen( -// onComplete = { navController.navigate(Screen.Home.route) } -// ) -// } - composable(Screen.Home.route) { - HomeScreen() - } - composable(Screen.Post.route) { - PostScreen() - } - composable(Screen.Form.route) { - FormScreen() - } - composable(Screen.Profile.route) { - ProfileScreen() - } - composable(Screen.Notification.route) { - NotificationScreen() - } - composable(Screen.Review.route) { - ReviewScreen() - } } } } From 0c340a141f68a7380c65cc62e8161255d09f460e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:13:49 +0900 Subject: [PATCH 0042/1079] =?UTF-8?q?style:=20Scaffold=EB=A5=BC=20?= =?UTF-8?q?=EB=A9=94=EC=9D=B8=EC=97=90=20=EC=9C=84=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/materip/matetrip/MainActivity.kt | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/materip/matetrip/MainActivity.kt b/app/src/main/java/com/materip/matetrip/MainActivity.kt index 8b1246b8..afdde86c 100644 --- a/app/src/main/java/com/materip/matetrip/MainActivity.kt +++ b/app/src/main/java/com/materip/matetrip/MainActivity.kt @@ -4,7 +4,15 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Scaffold +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController +import com.materip.matetrip.component.MateTripBottomBar +import com.materip.matetrip.navigation.GetTopBar +import com.materip.matetrip.navigation.Screen import com.materip.matetrip.navigation.SetUpNavGraph import com.materip.matetrip.ui.theme.MatetripTheme @@ -14,8 +22,30 @@ class MainActivity : ComponentActivity() { enableEdgeToEdge() setContent { MatetripTheme { - val navHost = rememberNavController() - SetUpNavGraph(navHost) + val navController = rememberNavController() + val currentBackStack by navController.currentBackStackEntryAsState() + val currentRoute = currentBackStack?.destination?.route + + Scaffold( + topBar = { + GetTopBar( + currentRoute = currentRoute, + navController = navController + ) + }, + bottomBar = { + MateTripBottomBar( + onHomeClick = { navController.navigate(Screen.Home.route) }, + onMyPageClick = { navController.navigate(Screen.MyPage.route) }, + onSettingClick = { navController.navigate(Screen.Setting.route) } + ) + } + ) { innerPadding -> + SetUpNavGraph( + navController = navController, + modifier = Modifier.padding(innerPadding) + ) + } } } } From 480592bef592dd7a5f6b586564578542b50d3c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:14:45 +0900 Subject: [PATCH 0043/1079] =?UTF-8?q?chore:=20material3,=20uiToolingPrevie?= =?UTF-8?q?wAndroid=20=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/libs.versions.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 08917394..7d75b554 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,6 +27,8 @@ hiltNavCompose = "1.0.0" kakao = "2.19.0" datastore = "1.1.1" navigationRuntimeKtx = "2.7.7" +material3Android = "1.2.1" +uiToolingPreviewAndroid = "1.6.8" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -53,7 +55,7 @@ serialization = { group = "org.jetbrains.kotlinx", name="kotlinx-serialization-j coroutine = { group = "org.jetbrains.kotlinx", name="kotlinx-coroutines-core", version.ref="coroutine"} coil = { group = "io.coil-kt", name="coil", version.ref="coil"} coil-compose = { group = "io.coil-kt", name="coil-compose", version.ref="coil"} -firebase-bom = { group = "com.gogole.firebase", name="firebase-bom", version.ref="firebaseBoM"} +firebase-bom = { group = "com.google.firebase", name="firebase-bom", version.ref="firebaseBoM"} firebase-analytics = { group = "com.google.firebase", name="firebase-analytics-ktx", version.ref="firebaseAnalytic"} navigation = { group = "androidx.navigation", name="navigation-compose", version.ref="navigation"} hilt-android = { group = "com.google.dagger", name="hilt-android", version.ref="hilt"} @@ -69,6 +71,8 @@ kakao-freind = { group = "com.kakao.sdk", name="v2-friend", version.ref="kakao"} kakao-cert = { group = "com.kakao.sdk", name="v2-cert", version.ref="kakao"} datastore = { group = "androidx.datastore", name="datastore-preferences", version.ref="datastore"} androidx-navigation-runtime-ktx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "navigationRuntimeKtx" } +androidx-material3-android = { group = "androidx.compose.material3", name = "material3-android", version.ref = "material3Android" } +androidx-ui-tooling-preview-android = { group = "androidx.compose.ui", name = "ui-tooling-preview-android", version.ref = "uiToolingPreviewAndroid" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } From 23b7da104e11952aa16718a4a766e2ba5f07c85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:15:14 +0900 Subject: [PATCH 0044/1079] =?UTF-8?q?design:=20setting=5Ficon=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/materip/matetrip/icon/Icons.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core-designsystem/src/main/java/com/materip/matetrip/icon/Icons.kt b/core-designsystem/src/main/java/com/materip/matetrip/icon/Icons.kt index 284896cd..9723bb48 100644 --- a/core-designsystem/src/main/java/com/materip/matetrip/icon/Icons.kt +++ b/core-designsystem/src/main/java/com/materip/matetrip/icon/Icons.kt @@ -21,4 +21,5 @@ object Icons { val place_icon = R.drawable.place_24px val review_icon = R.drawable.review_24px val search_icon = R.drawable.search_24px + val setting_icon = R.drawable.setting_24px } \ No newline at end of file From e3a94ed44d670d49fab891d08ea8340100210454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:15:51 +0900 Subject: [PATCH 0045/1079] =?UTF-8?q?style:=20internal=20=EB=8C=80?= =?UTF-8?q?=EC=8B=A0=20object=EB=A1=9C=20Color.kt=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/materip/matetrip/ui/theme/Color.kt | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/materip/matetrip/ui/theme/Color.kt b/app/src/main/java/com/materip/matetrip/ui/theme/Color.kt index f7e18dfe..75b04dc2 100644 --- a/app/src/main/java/com/materip/matetrip/ui/theme/Color.kt +++ b/app/src/main/java/com/materip/matetrip/ui/theme/Color.kt @@ -2,10 +2,31 @@ package com.materip.matetrip.ui.theme import androidx.compose.ui.graphics.Color -val Purple80 = Color(0xFFD0BCFF) -val PurpleGrey80 = Color(0xFFCCC2DC) -val Pink80 = Color(0xFFEFB8C8) +/** + * 메이트립 Android Color + */ +object MateTripColors { + // Main Color + val Primary = Color(0xFF3553F2) + val Blue_01 = Color(0xFF9BA1DA) + val Blue_02 = Color(0xFFBEC3EF) + val Blue_03 = Color(0xFFDDE1FC) + val Blue_04 = Color(0xFFEEF0FF) -val Purple40 = Color(0xFF6650a4) -val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) \ No newline at end of file + // Button Color + val ActivatedColor = Color(0xFF020514) + val InactiveColor = Color(0xFFDDDFEA) + + // Typography Color + val Gray_11 = Color(0xFF1C1B1F) + val Gray_10 = Color(0xFF313033) + val Gray_09 = Color(0xFF484649) + val Gray_08 = Color(0xFF605D62) + val Gray_07 = Color(0xFF787579) + val gray_06 = Color(0xFF939094) + val gray_05 = Color(0xFFAEAAAE) + val Gray_04 = Color(0xFFCECECE) + val Gray_03 = Color(0xFFE9E9E9) + val Gray_02 = Color(0xFFF4F4F4) + val Gray_01 = Color(0xFFFAFAFA) +} \ No newline at end of file From 658394c89086462c0fb7f087853e20d3d6bdeeb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:16:32 +0900 Subject: [PATCH 0046/1079] =?UTF-8?q?feat:=20BottomBar=20=EC=9E=91?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../materip/matetrip/component/BottomBar.kt | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 core-designsystem/src/main/java/com/materip/matetrip/component/BottomBar.kt diff --git a/core-designsystem/src/main/java/com/materip/matetrip/component/BottomBar.kt b/core-designsystem/src/main/java/com/materip/matetrip/component/BottomBar.kt new file mode 100644 index 00000000..3ac84511 --- /dev/null +++ b/core-designsystem/src/main/java/com/materip/matetrip/component/BottomBar.kt @@ -0,0 +1,114 @@ +package com.materip.matetrip.component + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.material3.BottomAppBar +import androidx.compose.material3.Icon +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.graphics.Color +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.materip.matetrip.icon.Icons +import com.materip.matetrip.theme.MateTripTypographySet +import com.materip.matetrip.theme.Primary +import com.materip.matetrip.theme.gray_06 + +@Composable +fun MateTripBottomBar( + onHomeClick: () -> Unit, + onMyPageClick: () -> Unit, + onSettingClick: () -> Unit +) { + var selectedTab by remember { mutableStateOf("home") } + + BottomAppBar( + modifier = Modifier + .width(360.dp) + .height(68.dp), + containerColor = Color.White, + contentPadding = PaddingValues(horizontal = 34.dp) + ) { + BottomBarItem( + iconRes = Icons.home_icon, + label = "홈", + isSelected = selectedTab == "home", + onClick = { + selectedTab = "home" + onHomeClick() + }, + modifier = Modifier.weight(1f) + ) + BottomBarItem( + iconRes = Icons.my_page_icon, + label = "마이페이지", + isSelected = selectedTab == "my_page", + onClick = { + selectedTab = "my_page" + onMyPageClick() + }, + modifier = Modifier.weight(1f) + ) + BottomBarItem( + iconRes = Icons.setting_icon, + label = "설정", + isSelected = selectedTab == "setting", + onClick = { + selectedTab = "setting" + onSettingClick() + }, + modifier = Modifier.weight(1f) + ) + } +} + +@Composable +fun BottomBarItem( + iconRes: Int, + label: String, + isSelected: Boolean, + onClick: () -> Unit, + modifier: Modifier = Modifier +) { + val color = if (isSelected) Primary else gray_06 + + Column( + modifier = modifier, + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Icon( + painter = painterResource(id = iconRes), + contentDescription = label, + tint = color, + modifier = Modifier.clickable(onClick = onClick) + ) + Text( + text = label, + style = MateTripTypographySet.title05, + color = color, + modifier = Modifier.clickable(onClick = onClick) + ) + } +} + +@Preview +@Composable +fun PreviewMateTripBottomBar() { + MateTripBottomBar( + onHomeClick = {}, + onMyPageClick = {}, + onSettingClick = {} + ) +} \ No newline at end of file From 71dcbb928ea8dd01da0eea19ffc84356429edf8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=83=81=EC=9D=80?= <71699054+vmkmym@users.noreply.github.com> Date: Thu, 8 Aug 2024 22:17:53 +0900 Subject: [PATCH 0047/1079] =?UTF-8?q?chore:=20app,=20design,=20home=20?= =?UTF-8?q?=EB=AA=A8=EB=93=88=EC=97=90=EC=84=9C=20compileOptions,=20kotlin?= =?UTF-8?q?Options,=20composeOptions=20=ED=86=B5=EC=9D=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - main브랜치에 merge된 login 모듈 의존성에 맞춰 컴파일, 코틀린, 컴포즈 버전 통일함 --- .idea/deploymentTargetSelector.xml | 4 ++-- app/build.gradle.kts | 8 ++++---- core-designsystem/build.gradle.kts | 8 ++++---- feature-home/build.gradle.kts | 14 +++++++++++--- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml index caeb0c51..ab28e6a2 100644 --- a/.idea/deploymentTargetSelector.xml +++ b/.idea/deploymentTargetSelector.xml @@ -4,10 +4,10 @@