From 1a8966a2dbd9e965c10c680b540dc583a1bfd59b Mon Sep 17 00:00:00 2001 From: Sohyun Date: Wed, 9 Oct 2024 19:42:50 +0900 Subject: [PATCH 01/21] #94 [FIX] : change home tab lottie height, add home empty view --- core/common/src/main/res/raw/tab_lottie.json | 2 +- feature/home/src/main/res/layout/fragment_home.xml | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/common/src/main/res/raw/tab_lottie.json b/core/common/src/main/res/raw/tab_lottie.json index 91e31d6d..52c758fc 100644 --- a/core/common/src/main/res/raw/tab_lottie.json +++ b/core/common/src/main/res/raw/tab_lottie.json @@ -1 +1 @@ -{"nm":"Main Scene","ddd":0,"h":4,"w":360,"meta":{"g":"@lottiefiles/creator 1.22.0"},"layers":[{"ty":4,"nm":"Rectangle 1","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0.5,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[180.5,1]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"rc","bm":0,"hd":false,"nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[360,2]}},{"ty":"gf","bm":0,"hd":false,"nm":"Fill","e":{"a":0,"k":[188,0]},"g":{"p":2,"k":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.5607843137254902,0.29411764705882354,1,1,0.00784313725490196,0.9137254901960784,0.8117647058823529],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.00784313725490196,0.9137254901960784,0.8117647058823529,1,0.5607843137254902,0.29411764705882354,1],"t":60},{"s":[0,0.5607843137254902,0.29411764705882354,1,1,0.00784313725490196,0.9137254901960784,0.8117647058823529],"t":120}]}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[-188,0]},"r":2,"o":{"a":0,"k":100}}],"ind":1}],"v":"5.7.0","fr":30,"op":120,"ip":0,"assets":[]} \ No newline at end of file +{"nm":"Main Scene","ddd":0,"h":4,"w":360,"meta":{"g":"@lottiefiles/creator 1.25.0"},"layers":[{"ty":4,"nm":"Rectangle 1","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[180,3]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"rc","bm":0,"hd":false,"nm":"Rectangle Path 1","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"s":{"a":0,"k":[360,2]}},{"ty":"gf","bm":0,"hd":false,"nm":"Fill","e":{"a":0,"k":[188,0]},"g":{"p":2,"k":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.5607843137254902,0.29411764705882354,1,1,0.00784313725490196,0.9137254901960784,0.8117647058823529],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0.00784313725490196,0.9137254901960784,0.8117647058823529,1,0.5607843137254902,0.29411764705882354,1],"t":60},{"s":[0,0.5607843137254902,0.29411764705882354,1,1,0.00784313725490196,0.9137254901960784,0.8117647058823529],"t":120}]}},"t":1,"a":{"a":0,"k":0},"h":{"a":0,"k":0},"s":{"a":0,"k":[-188,0]},"r":2,"o":{"a":0,"k":100}}],"ind":1}],"v":"5.7.0","fr":30,"op":120,"ip":0,"assets":[]} \ No newline at end of file diff --git a/feature/home/src/main/res/layout/fragment_home.xml b/feature/home/src/main/res/layout/fragment_home.xml index 73765cc3..6866954a 100644 --- a/feature/home/src/main/res/layout/fragment_home.xml +++ b/feature/home/src/main/res/layout/fragment_home.xml @@ -10,7 +10,6 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:backgroundTint="@color/white" - android:paddingBottom="2dp" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> @@ -71,4 +70,16 @@ app:pressedTranslationZ="0dp" app:tint="@null" /> + + From c958025a4d2c7f67a78f5723f8c9dbfce2fbb4bd Mon Sep 17 00:00:00 2001 From: Sohyun Date: Wed, 9 Oct 2024 19:44:04 +0900 Subject: [PATCH 02/21] #94 [FEAT] : add home empty view --- .../home/src/main/java/com/teamwable/home/HomeFragment.kt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/feature/home/src/main/java/com/teamwable/home/HomeFragment.kt b/feature/home/src/main/java/com/teamwable/home/HomeFragment.kt index dc637a73..2c1a61db 100644 --- a/feature/home/src/main/java/com/teamwable/home/HomeFragment.kt +++ b/feature/home/src/main/java/com/teamwable/home/HomeFragment.kt @@ -27,6 +27,7 @@ import com.teamwable.ui.extensions.setDividerWithPadding import com.teamwable.ui.extensions.stringOf import com.teamwable.ui.extensions.viewLifeCycle import com.teamwable.ui.extensions.viewLifeCycleScope +import com.teamwable.ui.extensions.visible import com.teamwable.ui.shareAdapter.FeedAdapter import com.teamwable.ui.shareAdapter.FeedClickListener import com.teamwable.ui.shareAdapter.FeedViewHolder @@ -179,6 +180,13 @@ class HomeFragment : BindingFragment(FragmentHomeBinding::i } } } + + viewLifeCycleScope.launch { + feedAdapter.loadStateFlow.collectLatest { loadStates -> + val isEmptyList = loadStates.refresh is LoadState.NotLoading && feedAdapter.itemCount == 0 + binding.tvEmpty.visible(isEmptyList) + } + } } private fun setSwipeLayout() { From a1e08be4ddaede8b249fa066e6f2d52cf5423ecb Mon Sep 17 00:00:00 2001 From: Sohyun Date: Wed, 9 Oct 2024 19:44:45 +0900 Subject: [PATCH 03/21] #94 [MOD] : remove unnecessary permission --- app/src/main/AndroidManifest.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b08a6bbf..b5f3b151 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,6 @@ - Date: Mon, 7 Oct 2024 19:00:46 +0900 Subject: [PATCH 04/21] =?UTF-8?q?#91=20[mod]=20:=20compose=20=EB=B2=84?= =?UTF-8?q?=EC=A0=84=20=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle/libs.versions.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1b55ae81..22cf5ef1 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -60,15 +60,15 @@ processPhoenix = "3.0.0" ## Compose # https://developer.android.com/develop/ui/compose/bom/bom-mapping -androidxComposeBom = "2024.05.00" +androidxComposeBom = "2024.09.03" # https://developer.android.com/jetpack/androidx/releases/compose-kotlin androidxComposeCompiler = "1.5.14" # https://developer.android.com/jetpack/androidx/releases/navigation -androidxComposeNavigation = "2.8.0-alpha08" +androidxComposeNavigation = "2.8.2" # https://developer.android.com/jetpack/androidx/releases/compose-material3 -androidxComposeMaterial3 = "1.3.0-rc01" +androidxComposeMaterial3 = "1.3.0" # # https://developer.android.com/jetpack/androidx/releases/test -androidxTestExt = "1.1.5" +androidxTestExt = "1.2.1" hiltNavigationComposeVersion = "1.2.0" firebaseMessagingKtx = "24.0.1" From 63c44d92dae79fe09c326171621c6a25e99662a3 Mon Sep 17 00:00:00 2001 From: chanu Date: Mon, 7 Oct 2024 19:02:22 +0900 Subject: [PATCH 05/21] #91 [add] : add compose navigation, model dependency in navigation module --- core/navigation/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 165a792b..61827d87 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -8,4 +8,6 @@ android { } dependencies { + implementation(project(":core:model")) + implementation(libs.androidx.compose.navigation) } From ed47fe43cf9e9459c3af93cc968af2aa9b5f54d5 Mon Sep 17 00:00:00 2001 From: chanu Date: Mon, 7 Oct 2024 19:02:36 +0900 Subject: [PATCH 06/21] #91 [add] : add serialization dependency in model module --- core/model/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index 788e6ed6..8ea2cd59 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id("com.android.library") id("com.teamwable.wable.kotlin") + id("com.teamwable.wable.serialization") } android { namespace = "com.teamwable.model" From 04e47c3d29a3a690e4e19f06d1b36202a7a9f8e6 Mon Sep 17 00:00:00 2001 From: chanu Date: Mon, 7 Oct 2024 19:13:40 +0900 Subject: [PATCH 07/21] #91 [feat]: Add CustomNavType to support generic types --- .../com/teamwable/navigation/CustomNavType.kt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt diff --git a/core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt b/core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt new file mode 100644 index 00000000..4d75b9b6 --- /dev/null +++ b/core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt @@ -0,0 +1,30 @@ +package com.teamwable.navigation + +import android.net.Uri +import android.os.Bundle +import androidx.navigation.NavType +import kotlinx.serialization.json.Json +import kotlinx.serialization.serializer + +object CustomNavType { + inline fun createNavType(): NavType = object : NavType( + isNullableAllowed = false, + ) { + override fun get(bundle: Bundle, key: String): T? { + val jsonString = bundle.getString(key) ?: return null + return Json.decodeFromString(serializer(), jsonString) + } + + override fun parseValue(value: String): T { + return Json.decodeFromString(serializer(), Uri.decode(value)) + } + + override fun serializeAsValue(value: T): String { + return Uri.encode(Json.encodeToString(serializer(), value)) + } + + override fun put(bundle: Bundle, key: String, value: T) { + bundle.putString(key, Json.encodeToString(serializer(), value)) + } + } +} From 8d00b42fe467fbc695c461a116ee15b84a41c71a Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:13:10 +0900 Subject: [PATCH 08/21] #91 [delete]: delete unused enum type --- .../com/teamwable/designsystem/type/MemberInfoType.kt | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 core/designsystem/src/main/java/com/teamwable/designsystem/type/MemberInfoType.kt diff --git a/core/designsystem/src/main/java/com/teamwable/designsystem/type/MemberInfoType.kt b/core/designsystem/src/main/java/com/teamwable/designsystem/type/MemberInfoType.kt deleted file mode 100644 index 45be48ae..00000000 --- a/core/designsystem/src/main/java/com/teamwable/designsystem/type/MemberInfoType.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.teamwable.designsystem.type - -enum class MemberInfoType { - MEMBER_LCK_YEAR, - MEMBER_FAN_TEAM, - MEMBER_NICKNAME, - MEMBER_DEFAULT_PROFILE_IMAGE, - MEMBER_PROFILE_URL, - IS_ALARM_ALLOWED, -} From 6161a5b5b22c88fceb634f50cc54cf6758fc528b Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:22:54 +0900 Subject: [PATCH 09/21] #91 [mod]: change route parameter type list to custom data class --- .../src/main/java/com/teamwable/navigation/Route.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/navigation/src/main/java/com/teamwable/navigation/Route.kt b/core/navigation/src/main/java/com/teamwable/navigation/Route.kt index 03b400d4..4f9eb778 100644 --- a/core/navigation/src/main/java/com/teamwable/navigation/Route.kt +++ b/core/navigation/src/main/java/com/teamwable/navigation/Route.kt @@ -1,5 +1,6 @@ package com.teamwable.navigation +import com.teamwable.model.profile.MemberInfoEditModel import kotlinx.serialization.Serializable sealed interface Route { @@ -13,11 +14,11 @@ sealed interface Route { data object FirstLckWatch : Route @Serializable - data class SelectLckTeam(val userList: List) : Route + data class SelectLckTeam(val memberInfoEditModel: MemberInfoEditModel) : Route @Serializable - data class Profile(val userList: List) : Route + data class Profile(val memberInfoEditModel: MemberInfoEditModel) : Route @Serializable - data class AgreeTerms(val userList: List) : Route + data class AgreeTerms(val memberInfoEditModel: MemberInfoEditModel, val profileUri: String?) : Route } From 5a542386d20e7a302dee2e9ca2e4d48cc590db52 Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:27:59 +0900 Subject: [PATCH 10/21] #91 [refactor] : Change lambda parameters List to data class --- .../com/teamwable/main_compose/MainNavigator.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/feature/main-compose/src/main/java/com/teamwable/main_compose/MainNavigator.kt b/feature/main-compose/src/main/java/com/teamwable/main_compose/MainNavigator.kt index c2f16c08..760b581d 100644 --- a/feature/main-compose/src/main/java/com/teamwable/main_compose/MainNavigator.kt +++ b/feature/main-compose/src/main/java/com/teamwable/main_compose/MainNavigator.kt @@ -10,6 +10,7 @@ import androidx.navigation.compose.currentBackStackEntryAsState import androidx.navigation.compose.rememberNavController import androidx.navigation.navOptions import com.teamwable.auth.naviagation.navigateLogin +import com.teamwable.model.profile.MemberInfoEditModel import com.teamwable.navigation.Route import com.teamwable.onboarding.agreeterms.naviagation.navigateToAgreeTerms import com.teamwable.onboarding.firstlckwatch.naviagation.navigateToFirstLckWatch @@ -33,16 +34,16 @@ class MainNavigator( navController.navigateToFirstLckWatch() } - fun navigateToSelectLckTeam(userList: List) { - navController.navigateToSelectLckTeam(userList) + fun navigateToSelectLckTeam(memberInfoEditModel: MemberInfoEditModel) { + navController.navigateToSelectLckTeam(memberInfoEditModel) } - fun navigateToProfile(userList: List) { - navController.navigateToProfile(userList) + fun navigateToProfile(memberInfoEditModel: MemberInfoEditModel) { + navController.navigateToProfile(memberInfoEditModel) } - fun navigateToAgreeTerms(userList: List) { - navController.navigateToAgreeTerms(userList) + fun navigateToAgreeTerms(memberInfoEditModel: MemberInfoEditModel, profileUri: String?) { + navController.navigateToAgreeTerms(memberInfoEditModel, profileUri) } private fun popBackStack() { From 6748f66af853705d25d13cbdb5016ca1b10a5950 Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:28:39 +0900 Subject: [PATCH 11/21] #91 [refactor] : Refactor navigation lambdas to method reference --- .../src/main/java/com/teamwable/main_compose/MainScreen.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feature/main-compose/src/main/java/com/teamwable/main_compose/MainScreen.kt b/feature/main-compose/src/main/java/com/teamwable/main_compose/MainScreen.kt index 490a7a0e..0f6c568d 100644 --- a/feature/main-compose/src/main/java/com/teamwable/main_compose/MainScreen.kt +++ b/feature/main-compose/src/main/java/com/teamwable/main_compose/MainScreen.kt @@ -91,15 +91,15 @@ internal fun MainScreen( onShowErrorSnackBar = onShowErrorSnackBar, ) firstLckWatchNavGraph( - navigateToSelectLckTeam = { userList -> navigator.navigateToSelectLckTeam(userList) }, + navigateToSelectLckTeam = navigator::navigateToSelectLckTeam, onShowErrorSnackBar = onShowErrorSnackBar, ) selectLckTeamNavGraph( - navigateToProfile = { userList -> navigator.navigateToProfile(userList) }, + navigateToProfile = navigator::navigateToProfile, onShowErrorSnackBar = onShowErrorSnackBar, ) profileNavGraph( - navigateToAgreeTerms = { userList -> navigator.navigateToAgreeTerms(userList) }, + navigateToAgreeTerms = navigator::navigateToAgreeTerms, onShowErrorSnackBar = onShowErrorSnackBar, ) agreeTermsNavGraph( From 1f01cdb8c0e06d40a3d51f21d607f48488c87e3f Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:29:29 +0900 Subject: [PATCH 12/21] #91 [add] : Add @Serializable annotation in MemberInfoEditModel --- .../java/com/teamwable/model/profile/MemberInfoEditModel.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/model/src/main/java/com/teamwable/model/profile/MemberInfoEditModel.kt b/core/model/src/main/java/com/teamwable/model/profile/MemberInfoEditModel.kt index 3a299be3..c985febe 100644 --- a/core/model/src/main/java/com/teamwable/model/profile/MemberInfoEditModel.kt +++ b/core/model/src/main/java/com/teamwable/model/profile/MemberInfoEditModel.kt @@ -2,7 +2,9 @@ package com.teamwable.model.profile import android.os.Parcelable import kotlinx.parcelize.Parcelize +import kotlinx.serialization.Serializable +@Serializable @Parcelize data class MemberInfoEditModel( val nickname: String? = null, From a0f493ca908630cdef7a4fdc12e8e67e2935078f Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:34:54 +0900 Subject: [PATCH 13/21] #91 [mod] : use custom nav type and change navcontroller parameter to custom data class --- .../naviagation/AgreeTermsNavigation.kt | 16 +++++++++++++--- .../naviagation/FirstLckWatchNavigation.kt | 3 ++- .../profile/naviagation/ProfileNavigation.kt | 15 +++++++++++---- .../naviagation/SelectLckTeamNavigation.kt | 15 +++++++++++---- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt index 14a4d517..8bb88a41 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt @@ -4,18 +4,28 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute +import com.teamwable.model.profile.MemberInfoEditModel +import com.teamwable.navigation.CustomNavType import com.teamwable.navigation.Route import com.teamwable.onboarding.agreeterms.AgreeTermsRoute +import kotlin.reflect.typeOf -fun NavController.navigateToAgreeTerms(userList: List) { - this.navigate(Route.AgreeTerms(userList)) +fun NavController.navigateToAgreeTerms( + memberInfoEditModel: MemberInfoEditModel, + profileUri: String?, +) { + this.navigate(Route.AgreeTerms(memberInfoEditModel, profileUri)) } fun NavGraphBuilder.agreeTermsNavGraph( navigateToHome: () -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { - composable { backStackEntry -> + composable( + typeMap = mapOf( + typeOf() to CustomNavType.createNavType(), + ), + ) { backStackEntry -> val args = backStackEntry.toRoute() AgreeTermsRoute( navigateToHome = navigateToHome, diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/naviagation/FirstLckWatchNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/naviagation/FirstLckWatchNavigation.kt index 68e754bf..42893717 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/naviagation/FirstLckWatchNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/naviagation/FirstLckWatchNavigation.kt @@ -3,6 +3,7 @@ package com.teamwable.onboarding.firstlckwatch.naviagation import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable +import com.teamwable.model.profile.MemberInfoEditModel import com.teamwable.navigation.Route import com.teamwable.onboarding.firstlckwatch.FirstLckWatchRoute @@ -11,7 +12,7 @@ fun NavController.navigateToFirstLckWatch() { } fun NavGraphBuilder.firstLckWatchNavGraph( - navigateToSelectLckTeam: (userList: List) -> Unit, + navigateToSelectLckTeam: (memberInfo: MemberInfoEditModel) -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { composable { diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt index d7ea5284..95c382b0 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt @@ -4,18 +4,25 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute +import com.teamwable.model.profile.MemberInfoEditModel +import com.teamwable.navigation.CustomNavType import com.teamwable.navigation.Route import com.teamwable.onboarding.profile.ProfileRoute +import kotlin.reflect.typeOf -fun NavController.navigateToProfile(userList: List) { - this.navigate(Route.Profile(userList)) +fun NavController.navigateToProfile(memberInfoEditModel: MemberInfoEditModel) { + this.navigate(Route.Profile(memberInfoEditModel)) } fun NavGraphBuilder.profileNavGraph( - navigateToAgreeTerms: (List) -> Unit, + navigateToAgreeTerms: (MemberInfoEditModel, String?) -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { - composable { backStackEntry -> + composable( + typeMap = mapOf( + typeOf() to CustomNavType.createNavType(), + ), + ) { backStackEntry -> val args = backStackEntry.toRoute() ProfileRoute( navigateToAgreeTerms = navigateToAgreeTerms, diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt index 1d499452..e3838944 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt @@ -4,18 +4,25 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute +import com.teamwable.model.profile.MemberInfoEditModel +import com.teamwable.navigation.CustomNavType import com.teamwable.navigation.Route import com.teamwable.onboarding.selectlckteam.SelectLckTeamRoute +import kotlin.reflect.typeOf -fun NavController.navigateToSelectLckTeam(userList: List) { - this.navigate(Route.SelectLckTeam(userList)) +fun NavController.navigateToSelectLckTeam(memberInfoEdit: MemberInfoEditModel) { + this.navigate(Route.SelectLckTeam(memberInfoEdit)) } fun NavGraphBuilder.selectLckTeamNavGraph( - navigateToProfile: (List) -> Unit, + navigateToProfile: (MemberInfoEditModel) -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { - composable { backStackEntry -> + composable( + typeMap = mapOf( + typeOf() to CustomNavType.createNavType(), + ), + ) { backStackEntry -> val args = backStackEntry.toRoute() SelectLckTeamRoute( navigateToProfile = navigateToProfile, From 9da7f85d0a170219b3dadd2e826da6d109bc45b0 Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 00:56:48 +0900 Subject: [PATCH 14/21] =?UTF-8?q?#91=20[mod]=20:=20nav=20args=20=EA=B0=92?= =?UTF-8?q?=20MemberInfoEditModel=20=EA=B0=9D=EC=B2=B4=EB=A1=9C=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B2=98=EB=A6=AC=20=ED=86=B5?= =?UTF-8?q?=EC=9D=BC=20=EB=B0=8F=20=EC=83=81=ED=83=9C=20=EA=B4=80=EB=A6=AC?= =?UTF-8?q?=20=EA=B0=84=EC=86=8C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../onboarding/agreeterms/AgreeTermsScreen.kt | 16 +++++----------- .../firstlckwatch/FirstLckWatchScreen.kt | 19 +++++++------------ .../onboarding/profile/ProfileScreen.kt | 17 ++++++++--------- .../selectlckteam/SelectLckTeamScreen.kt | 12 +++++------- 4 files changed, 25 insertions(+), 39 deletions(-) diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/AgreeTermsScreen.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/AgreeTermsScreen.kt index 9a53dc35..fbe1a76b 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/AgreeTermsScreen.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/AgreeTermsScreen.kt @@ -30,13 +30,10 @@ import com.teamwable.designsystem.component.checkbox.WableCheckBoxWithText import com.teamwable.designsystem.component.dialog.WableButtonDialog import com.teamwable.designsystem.theme.WableTheme import com.teamwable.designsystem.type.DialogType -import com.teamwable.designsystem.type.MemberInfoType -import com.teamwable.model.profile.MemberInfoEditModel import com.teamwable.navigation.Route import com.teamwable.onboarding.R import com.teamwable.onboarding.agreeterms.model.AgreeTerm import com.teamwable.onboarding.agreeterms.model.AgreeTermsSideEffect -import kotlinx.collections.immutable.toPersistentList @Composable fun AgreeTermsRoute( @@ -48,7 +45,7 @@ fun AgreeTermsRoute( val lifecycleOwner = LocalLifecycleOwner.current val showDialog by viewModel.showDialog.collectAsStateWithLifecycle() - val userInfo = args.userList.toPersistentList() + val memberInfoEditModel = args.memberInfoEditModel LaunchedEffect(lifecycleOwner) { viewModel.sideEffect.flowWithLifecycle(lifecycleOwner.lifecycle) @@ -64,14 +61,11 @@ fun AgreeTermsRoute( AgreeTermsScreen( onNextBtnClick = { marketingConsent -> viewModel.patchUserProfile( - memberInfoEditModel = MemberInfoEditModel( - nickname = userInfo[MemberInfoType.MEMBER_NICKNAME.ordinal], + memberInfoEditModel = memberInfoEditModel.copy( isAlarmAllowed = marketingConsent, - memberLckYears = userInfo[MemberInfoType.MEMBER_LCK_YEAR.ordinal].toInt(), - memberFanTeam = userInfo[MemberInfoType.MEMBER_FAN_TEAM.ordinal], - memberDefaultProfileImage = userInfo[MemberInfoType.MEMBER_DEFAULT_PROFILE_IMAGE.ordinal].takeIf { it.isNotEmpty() }, + memberDefaultProfileImage = memberInfoEditModel.memberDefaultProfileImage.takeIf { !it.isNullOrEmpty() }, ), - imgUrl = userInfo[MemberInfoType.MEMBER_PROFILE_URL.ordinal].takeIf { it.isNotEmpty() }, + imgUrl = args.profileUri.takeIf { !it.isNullOrEmpty() }, ) trackEvent(CLICK_COMPLETE_TNC_SIGNUP) }, @@ -79,7 +73,7 @@ fun AgreeTermsRoute( if (showDialog) { WableButtonDialog( - userName = userInfo[MemberInfoType.MEMBER_NICKNAME.ordinal], + userName = memberInfoEditModel.nickname.orEmpty(), dialogType = DialogType.WELLCOME, onClick = { viewModel.navigateToHome() diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/FirstLckWatchScreen.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/FirstLckWatchScreen.kt index 249f5950..3e86368c 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/FirstLckWatchScreen.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/firstlckwatch/FirstLckWatchScreen.kt @@ -30,7 +30,7 @@ import com.teamwable.common.util.AmplitudeUtil.trackEvent import com.teamwable.designsystem.component.button.WableButton import com.teamwable.designsystem.extension.system.SetStatusBarColor import com.teamwable.designsystem.theme.WableTheme -import com.teamwable.designsystem.type.MemberInfoType +import com.teamwable.model.profile.MemberInfoEditModel import com.teamwable.onboarding.R import com.teamwable.onboarding.firstlckwatch.component.WableExposedDropdownBox import com.teamwable.onboarding.firstlckwatch.model.FirstLckWatchSideEffect @@ -39,20 +39,17 @@ import kotlinx.collections.immutable.toPersistentList @Composable fun FirstLckWatchRoute( viewModel: FirstLckWatchViewModel = hiltViewModel(), - navigateToSelectLckTeam: (List) -> Unit, + navigateToSelectLckTeam: (MemberInfoEditModel) -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { val lifecycleOwner = LocalLifecycleOwner.current - - val userListSize = MemberInfoType.entries.size - val userList: List = List(userListSize) { "" } - var userMutableList by remember { mutableStateOf(userList) } + var memberInfoEditModel by remember { mutableStateOf(MemberInfoEditModel()) } LaunchedEffect(lifecycleOwner) { viewModel.firstLckWatchSideEffect.flowWithLifecycle(lifecycleOwner.lifecycle) .collect { sideEffect -> when (sideEffect) { - is FirstLckWatchSideEffect.NavigateToSelectLckTeam -> navigateToSelectLckTeam(userMutableList) + is FirstLckWatchSideEffect.NavigateToSelectLckTeam -> navigateToSelectLckTeam(memberInfoEditModel) else -> Unit } } @@ -60,9 +57,7 @@ fun FirstLckWatchRoute( FirstLckWatchScreen( onNextBtnClick = { - userMutableList = userMutableList.toMutableList().apply { - set(MemberInfoType.MEMBER_LCK_YEAR.ordinal, it) - } + memberInfoEditModel = memberInfoEditModel.copy(memberLckYears = it) viewModel.navigateToSelectTeam() trackEvent(CLICK_NEXT_YEAR_SIGNUP) }, @@ -71,7 +66,7 @@ fun FirstLckWatchRoute( @Composable fun FirstLckWatchScreen( - onNextBtnClick: (String) -> Unit, + onNextBtnClick: (Int) -> Unit, ) { SetStatusBarColor(color = WableTheme.colors.white) @@ -138,7 +133,7 @@ fun FirstLckWatchScreen( WableButton( text = stringResource(R.string.btn_next_text), - onClick = { onNextBtnClick(options[selectedIndex].toString()) }, + onClick = { onNextBtnClick(options[selectedIndex]) }, enabled = true, modifier = Modifier.padding(bottom = 24.dp), ) diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/ProfileScreen.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/ProfileScreen.kt index 624f2653..621bc0a0 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/ProfileScreen.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/ProfileScreen.kt @@ -41,10 +41,10 @@ import com.teamwable.designsystem.component.dialog.PermissionAppSettingsDialog import com.teamwable.designsystem.component.textfield.WableBasicTextField import com.teamwable.designsystem.extension.system.navigateToAppSettings import com.teamwable.designsystem.theme.WableTheme -import com.teamwable.designsystem.type.MemberInfoType import com.teamwable.designsystem.type.NicknameType import com.teamwable.designsystem.type.ProfileEditType import com.teamwable.designsystem.type.ProfileImageType +import com.teamwable.model.profile.MemberInfoEditModel import com.teamwable.navigation.Route import com.teamwable.onboarding.R import com.teamwable.onboarding.profile.component.ProfileImagePicker @@ -59,14 +59,14 @@ import timber.log.Timber internal fun ProfileRoute( viewModel: ProfileViewModel = hiltViewModel(), args: Route.Profile, - navigateToAgreeTerms: (List) -> Unit, + navigateToAgreeTerms: (MemberInfoEditModel, String?) -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { val lifecycleOwner = LocalLifecycleOwner.current val context = LocalContext.current val profileState by viewModel.profileState.collectAsStateWithLifecycle() - var userMutableList by remember { mutableStateOf(args.userList) } + var memberInfoEditModel by remember { mutableStateOf(args.memberInfoEditModel) } var openDialog by remember { mutableStateOf(false) } val permissionLauncher = rememberLauncherForActivityResult( @@ -102,7 +102,7 @@ internal fun ProfileRoute( viewModel.sideEffect.flowWithLifecycle(lifecycleOwner.lifecycle) .collect { sideEffect -> when (sideEffect) { - is ProfileSideEffect.NavigateToAgreeTerms -> navigateToAgreeTerms(userMutableList) + is ProfileSideEffect.NavigateToAgreeTerms -> navigateToAgreeTerms(memberInfoEditModel, profileState.selectedImageUri) is ProfileSideEffect.ShowPermissionDeniedDialog -> openDialog = true @@ -128,11 +128,10 @@ internal fun ProfileRoute( profileState = profileState, profileEditType = ProfileEditType.ONBOARDING, onNextBtnClick = { nickname, imageUri, defaultImage -> - userMutableList = userMutableList.toMutableList().apply { - set(MemberInfoType.MEMBER_NICKNAME.ordinal, nickname) - set(MemberInfoType.MEMBER_PROFILE_URL.ordinal, imageUri.orEmpty()) - set(MemberInfoType.MEMBER_DEFAULT_PROFILE_IMAGE.ordinal, defaultImage.orEmpty()) - } + memberInfoEditModel = memberInfoEditModel.copy( + nickname = nickname, + memberDefaultProfileImage = defaultImage.orEmpty(), + ) viewModel.navigateToAgreeTerms() trackEvent(CLICK_NEXT_PROFILE_SIGNUP) }, diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt index 11e213fe..9ca6ae3e 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/SelectLckTeamScreen.kt @@ -34,7 +34,7 @@ import com.teamwable.designsystem.component.button.WableButton import com.teamwable.designsystem.extension.modifier.noRippleDebounceClickable import com.teamwable.designsystem.theme.WableTheme import com.teamwable.designsystem.type.LckTeamType -import com.teamwable.designsystem.type.MemberInfoType +import com.teamwable.model.profile.MemberInfoEditModel import com.teamwable.navigation.Route import com.teamwable.onboarding.R import com.teamwable.onboarding.selectlckteam.component.LckTeamItem @@ -44,17 +44,17 @@ import com.teamwable.onboarding.selectlckteam.model.SelectLckTeamSideEffect fun SelectLckTeamRoute( viewModel: SelectLckTeamViewModel = hiltViewModel(), args: Route.SelectLckTeam, - navigateToProfile: (List) -> Unit, + navigateToProfile: (MemberInfoEditModel) -> Unit, onShowErrorSnackBar: (throwable: Throwable?) -> Unit, ) { val lifecycleOwner = LocalLifecycleOwner.current - var userMutableList by remember { mutableStateOf(args.userList) } + var memberInfoEditModel by remember { mutableStateOf(args.memberInfoEditModel) } LaunchedEffect(lifecycleOwner) { viewModel.firstLckWatchSideEffect.flowWithLifecycle(lifecycleOwner.lifecycle) .collect { sideEffect -> when (sideEffect) { - is SelectLckTeamSideEffect.NavigateToProfile -> navigateToProfile(userMutableList) + is SelectLckTeamSideEffect.NavigateToProfile -> navigateToProfile(memberInfoEditModel) else -> Unit } } @@ -62,9 +62,7 @@ fun SelectLckTeamRoute( SelectLckTeamScreen( onNextBtnClick = { - userMutableList = userMutableList.toMutableList().apply { - set(MemberInfoType.MEMBER_FAN_TEAM.ordinal, it) - } + memberInfoEditModel = memberInfoEditModel.copy(memberFanTeam = it) viewModel.navigateToProfile() if (it.isNotEmpty()) trackEvent(CLICK_NEXT_TEAM_SIGNUP) else trackEvent(CLICK_DETOUR_TEAM_SIGNUP) From 25c1942a74e84dec784da6f0b9c70ab0c301bc9d Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 01:00:49 +0900 Subject: [PATCH 15/21] =?UTF-8?q?#91=20[fix]=20:=20=EC=84=9C=EB=B2=84=20db?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EC=8B=9C,=20IsNewUser=EC=97=90?= =?UTF-8?q?=EC=84=9C=20nickname=EC=9C=BC=EB=A1=9C=20checkIsNewUser=20?= =?UTF-8?q?=ED=8C=90=EB=B3=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- feature/auth/src/main/java/com/teamwable/auth/LoginViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/auth/src/main/java/com/teamwable/auth/LoginViewModel.kt b/feature/auth/src/main/java/com/teamwable/auth/LoginViewModel.kt index 13bf901c..c3e40b63 100644 --- a/feature/auth/src/main/java/com/teamwable/auth/LoginViewModel.kt +++ b/feature/auth/src/main/java/com/teamwable/auth/LoginViewModel.kt @@ -87,7 +87,7 @@ class LoginViewModel @Inject constructor( saveAccessToken(response.accessToken) saveRefreshToken(response.refreshToken) saveMemberId(response.memberId) - checkIsNewUser(response.isNewUser) + checkIsNewUser(response.nickName.isBlank()) }.onFailure { _loginSideEffect.emit(LoginSideEffect.ShowSnackBar(it)) } From ad4e1907d5e2e2ad73f66d61519187a1a50b5bf6 Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 01:01:24 +0900 Subject: [PATCH 16/21] =?UTF-8?q?#91=20[chore]=20:=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=ED=95=9C=20=EC=BD=AC=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/teamwable/wable/WableApp.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/main/java/com/teamwable/wable/WableApp.kt b/app/src/main/java/com/teamwable/wable/WableApp.kt index 3dbff954..1f545c42 100644 --- a/app/src/main/java/com/teamwable/wable/WableApp.kt +++ b/app/src/main/java/com/teamwable/wable/WableApp.kt @@ -8,7 +8,6 @@ import android.content.Context import android.os.Build import androidx.appcompat.app.AppCompatDelegate import com.kakao.sdk.common.KakaoSdk -import com.kakao.sdk.common.util.Utility import com.teamwable.common.util.AmplitudeUtil.initAmplitude import com.teamwable.ui.util.FcmTag.CHANNEL_ID import com.teamwable.ui.util.FcmTag.CHANNEL_NAME @@ -44,8 +43,6 @@ class WableApp : Application() { private fun setKaKaoSdk() { KakaoSdk.init(this, KAKAO_APP_KEY) - var keyHash = Utility.getKeyHash(this) - Timber.tag("Kakao").d("KeyHash: $keyHash") } private fun createNotificationChannel() { From 8d472fd1fae11dfe85e020b3b7dbd4dd005f548a Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 02:10:30 +0900 Subject: [PATCH 17/21] #91 [refactor] : refactor CustomNavType using parcelable --- .../com/teamwable/navigation/CustomNavType.kt | 30 ----------------- .../teamwable/navigation/ParcelableNavType.kt | 32 +++++++++++++++++++ .../naviagation/AgreeTermsNavigation.kt | 4 +-- .../profile/naviagation/ProfileNavigation.kt | 4 +-- .../naviagation/SelectLckTeamNavigation.kt | 4 +-- 5 files changed, 38 insertions(+), 36 deletions(-) delete mode 100644 core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt create mode 100644 core/navigation/src/main/java/com/teamwable/navigation/ParcelableNavType.kt diff --git a/core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt b/core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt deleted file mode 100644 index 4d75b9b6..00000000 --- a/core/navigation/src/main/java/com/teamwable/navigation/CustomNavType.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.teamwable.navigation - -import android.net.Uri -import android.os.Bundle -import androidx.navigation.NavType -import kotlinx.serialization.json.Json -import kotlinx.serialization.serializer - -object CustomNavType { - inline fun createNavType(): NavType = object : NavType( - isNullableAllowed = false, - ) { - override fun get(bundle: Bundle, key: String): T? { - val jsonString = bundle.getString(key) ?: return null - return Json.decodeFromString(serializer(), jsonString) - } - - override fun parseValue(value: String): T { - return Json.decodeFromString(serializer(), Uri.decode(value)) - } - - override fun serializeAsValue(value: T): String { - return Uri.encode(Json.encodeToString(serializer(), value)) - } - - override fun put(bundle: Bundle, key: String, value: T) { - bundle.putString(key, Json.encodeToString(serializer(), value)) - } - } -} diff --git a/core/navigation/src/main/java/com/teamwable/navigation/ParcelableNavType.kt b/core/navigation/src/main/java/com/teamwable/navigation/ParcelableNavType.kt new file mode 100644 index 00000000..627ca06f --- /dev/null +++ b/core/navigation/src/main/java/com/teamwable/navigation/ParcelableNavType.kt @@ -0,0 +1,32 @@ +package com.teamwable.navigation + +import android.net.Uri +import android.os.Build.VERSION.SDK_INT +import android.os.Bundle +import android.os.Parcelable +import androidx.navigation.NavType +import kotlinx.serialization.encodeToString +import kotlinx.serialization.json.Json + +inline fun parcelableNavType(): NavType = object : NavType( + isNullableAllowed = false, +) { + override fun get(bundle: Bundle, key: String): T? = + bundle.parcelable(key) + + override fun parseValue(value: String): T = + Json.decodeFromString(Uri.decode(value)) + + override fun serializeAsValue(value: T): String = + Uri.encode(Json.encodeToString(value)) + + override fun put(bundle: Bundle, key: String, value: T) { + bundle.putParcelable(key, value) + } +} + +inline fun Bundle.parcelable(key: String): T? = when { + SDK_INT >= 33 -> getParcelable(key, T::class.java) + else -> @Suppress("DEPRECATION") + getParcelable(key) as? T +} diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt index 8bb88a41..ec7d8717 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/agreeterms/naviagation/AgreeTermsNavigation.kt @@ -5,8 +5,8 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute import com.teamwable.model.profile.MemberInfoEditModel -import com.teamwable.navigation.CustomNavType import com.teamwable.navigation.Route +import com.teamwable.navigation.parcelableNavType import com.teamwable.onboarding.agreeterms.AgreeTermsRoute import kotlin.reflect.typeOf @@ -23,7 +23,7 @@ fun NavGraphBuilder.agreeTermsNavGraph( ) { composable( typeMap = mapOf( - typeOf() to CustomNavType.createNavType(), + typeOf() to parcelableNavType(), ), ) { backStackEntry -> val args = backStackEntry.toRoute() diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt index 95c382b0..20df37f9 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/profile/naviagation/ProfileNavigation.kt @@ -5,8 +5,8 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute import com.teamwable.model.profile.MemberInfoEditModel -import com.teamwable.navigation.CustomNavType import com.teamwable.navigation.Route +import com.teamwable.navigation.parcelableNavType import com.teamwable.onboarding.profile.ProfileRoute import kotlin.reflect.typeOf @@ -20,7 +20,7 @@ fun NavGraphBuilder.profileNavGraph( ) { composable( typeMap = mapOf( - typeOf() to CustomNavType.createNavType(), + typeOf() to parcelableNavType(), ), ) { backStackEntry -> val args = backStackEntry.toRoute() diff --git a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt index e3838944..4f4331ce 100644 --- a/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt +++ b/feature/onboarding/src/main/java/com/teamwable/onboarding/selectlckteam/naviagation/SelectLckTeamNavigation.kt @@ -5,8 +5,8 @@ import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute import com.teamwable.model.profile.MemberInfoEditModel -import com.teamwable.navigation.CustomNavType import com.teamwable.navigation.Route +import com.teamwable.navigation.parcelableNavType import com.teamwable.onboarding.selectlckteam.SelectLckTeamRoute import kotlin.reflect.typeOf @@ -20,7 +20,7 @@ fun NavGraphBuilder.selectLckTeamNavGraph( ) { composable( typeMap = mapOf( - typeOf() to CustomNavType.createNavType(), + typeOf() to parcelableNavType(), ), ) { backStackEntry -> val args = backStackEntry.toRoute() From f0f3e1fb579be3e803adc84391878d4cbfc86512 Mon Sep 17 00:00:00 2001 From: chanu Date: Tue, 8 Oct 2024 02:10:45 +0900 Subject: [PATCH 18/21] #91 [chore] : delete unused code --- .../extension/bundle/getSafeParcelable.kt | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 core/designsystem/src/main/java/com/teamwable/designsystem/extension/bundle/getSafeParcelable.kt diff --git a/core/designsystem/src/main/java/com/teamwable/designsystem/extension/bundle/getSafeParcelable.kt b/core/designsystem/src/main/java/com/teamwable/designsystem/extension/bundle/getSafeParcelable.kt deleted file mode 100644 index 15fbec4e..00000000 --- a/core/designsystem/src/main/java/com/teamwable/designsystem/extension/bundle/getSafeParcelable.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.teamwable.designsystem.extension.bundle - -import android.os.Build -import android.os.Bundle -import android.os.Parcelable - -inline fun Bundle?.getSafeParcelable(key: String): T? { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - this?.getParcelable(key, T::class.java) - } else { - this?.getParcelable(key) as? T - } -} From 8b4f4132f996a8bd299fc9acd15c559a93a6859b Mon Sep 17 00:00:00 2001 From: Sohyun Date: Wed, 9 Oct 2024 21:43:39 +0900 Subject: [PATCH 19/21] #94 [UI] : change dk team tag color --- core/ui/src/main/res/values/colors.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/ui/src/main/res/values/colors.xml b/core/ui/src/main/res/values/colors.xml index fbca0b31..6aefda39 100644 --- a/core/ui/src/main/res/values/colors.xml +++ b/core/ui/src/main/res/values/colors.xml @@ -33,8 +33,8 @@ #FFE3EAE7 #FF1004A4 #FFE4E3F3 - #FF4A4A4A - #FFEDEDED + #FF4F5551 + #FFE0F7E7 #FFFF0A09 #FFFCE4E4 #FFD31F28 From 2a453c6643d5e5bf315070235cb592fb142ea2bc Mon Sep 17 00:00:00 2001 From: Sohyun Date: Thu, 10 Oct 2024 13:17:37 +0900 Subject: [PATCH 20/21] #94 [FEAT] : change rank season text (temp) --- .../main/java/com/teamwable/news/rank/NewsRankFragment.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/feature/news/src/main/java/com/teamwable/news/rank/NewsRankFragment.kt b/feature/news/src/main/java/com/teamwable/news/rank/NewsRankFragment.kt index 11673f55..2fcb2c84 100644 --- a/feature/news/src/main/java/com/teamwable/news/rank/NewsRankFragment.kt +++ b/feature/news/src/main/java/com/teamwable/news/rank/NewsRankFragment.kt @@ -1,7 +1,5 @@ package com.teamwable.news.rank -import android.content.Intent -import android.net.Uri import android.text.Spannable import android.text.SpannableString import android.text.style.ForegroundColorSpan @@ -37,7 +35,8 @@ class NewsRankFragment : BindingFragment(FragmentNewsRa private fun setupGameTypeObserve() { viewModel.gameTypeUiState.flowWithLifecycle(viewLifeCycle).onEach { when (it) { - is UiState.Success -> setSeasonText(it.data) + // 임시 하드 코딩 + is UiState.Success -> setSeasonText("2024 LCK Summer") else -> Unit } }.launchIn(viewLifeCycleScope) @@ -76,7 +75,7 @@ class NewsRankFragment : BindingFragment(FragmentNewsRa spannableString.setSpan( ForegroundColorSpan(colorOf(com.teamwable.ui.R.color.sky_50)), 16, spannableString.length, - Spannable.SPAN_EXCLUSIVE_EXCLUSIVE + Spannable.SPAN_EXCLUSIVE_EXCLUSIVE, ) binding.btnNewsRankOpinion.text = spannableString From 76c91a4084ebc7abbff8fcfe47fa95c45c560a15 Mon Sep 17 00:00:00 2001 From: Sohyun Date: Fri, 11 Oct 2024 14:18:14 +0900 Subject: [PATCH 21/21] #94 [FIX] : fix binding error --- .../com/teamwable/profile/profile/BindingProfileFragment.kt | 2 +- .../java/com/teamwable/profile/profile/ProfileMemberFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/feature/profile/src/main/java/com/teamwable/profile/profile/BindingProfileFragment.kt b/feature/profile/src/main/java/com/teamwable/profile/profile/BindingProfileFragment.kt index 35b9f9f4..2839d381 100644 --- a/feature/profile/src/main/java/com/teamwable/profile/profile/BindingProfileFragment.kt +++ b/feature/profile/src/main/java/com/teamwable/profile/profile/BindingProfileFragment.kt @@ -28,7 +28,7 @@ abstract class BindingProfileFragment : Fragment() { container: ViewGroup?, savedInstanceState: Bundle?, ): View? { - _binding = FragmentProfileBinding.inflate(layoutInflater) + _binding = FragmentProfileBinding.inflate(inflater, container, false) return binding.root } diff --git a/feature/profile/src/main/java/com/teamwable/profile/profile/ProfileMemberFragment.kt b/feature/profile/src/main/java/com/teamwable/profile/profile/ProfileMemberFragment.kt index efa883dc..1912dacf 100644 --- a/feature/profile/src/main/java/com/teamwable/profile/profile/ProfileMemberFragment.kt +++ b/feature/profile/src/main/java/com/teamwable/profile/profile/ProfileMemberFragment.kt @@ -28,7 +28,7 @@ class ProfileMemberFragment : BindingProfileFragment() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - userId = arguments?.getLong(Arg.PROFILE_USER_ID) ?: -1L + userId = arguments?.getLong(Arg.PROFILE_USER_ID) ?: return } override fun onViewCreated(view: View, savedInstanceState: Bundle?) {