diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7a0985b3..c806410b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -41,6 +41,7 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) + isDebuggable = false } } buildFeatures { diff --git a/core/navigation/src/main/java/com/goalpanzi/mission_mate/core/navigation/RouteModel.kt b/core/navigation/src/main/java/com/goalpanzi/mission_mate/core/navigation/RouteModel.kt index 3f73f3ff..7c633133 100644 --- a/core/navigation/src/main/java/com/goalpanzi/mission_mate/core/navigation/RouteModel.kt +++ b/core/navigation/src/main/java/com/goalpanzi/mission_mate/core/navigation/RouteModel.kt @@ -36,9 +36,6 @@ sealed interface OnboardingRouteModel { sealed interface SettingRouteModel { - @Serializable - data object Inquiry : SettingRouteModel - @Serializable data object ServicePolicy : SettingRouteModel diff --git a/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginNavigation.kt b/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginNavigation.kt index 4653bdfd..7aea62d9 100644 --- a/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginNavigation.kt +++ b/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginNavigation.kt @@ -6,7 +6,11 @@ import androidx.navigation.compose.composable import com.goalpanzi.mission_mate.core.navigation.RouteModel fun NavController.navigateToLogin() { - this.navigate(RouteModel.Login) + this.navigate(RouteModel.Login) { + popUpTo(this@navigateToLogin.graph.id){ + inclusive = true + } + } } fun NavGraphBuilder.loginNavGraph( diff --git a/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginScreen.kt b/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginScreen.kt index 06bd3091..81429df4 100644 --- a/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginScreen.kt +++ b/feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginScreen.kt @@ -2,23 +2,18 @@ package com.goalpanzi.mission_mate.feature.login import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.border import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column -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.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBarsPadding -import androidx.compose.foundation.layout.width +import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.layout.wrapContentSize import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -35,7 +30,6 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel -import com.goalpanzi.mission_mate.core.designsystem.theme.ColorFFF5EDEA import com.goalpanzi.mission_mate.core.designsystem.theme.ColorWhite_FFFFFFFF import com.goalpanzi.mission_mate.core.designsystem.theme.Color_FFFF5632 import com.goalpanzi.mission_mate.core.designsystem.theme.MissionMateTypography @@ -76,14 +70,12 @@ fun LoginScreen( modifier = modifier .fillMaxSize() .navigationBarsPadding() - .background(color = Color_FFFF5632) - .statusBarsPadding(), + .background(color = Color_FFFF5632), horizontalAlignment = Alignment.CenterHorizontally ) { - Spacer(modifier = Modifier.weight(1f)) Image( modifier = Modifier - .padding(bottom = 48.dp) + .padding(top = 110.dp) .size(48.dp), painter = painterResource(id = com.goalpanzi.mission_mate.core.designsystem.R.drawable.img_app_logo), contentDescription = "rabbit" @@ -91,9 +83,10 @@ fun LoginScreen( Image( modifier = Modifier - .padding(bottom = 30.dp) - .width(266.dp) - .wrapContentHeight(), + .fillMaxWidth() + .widthIn(max = 266.dp) + .padding(horizontal = 62.dp) + .padding(top = 48.dp), painter = painterResource(id = com.goalpanzi.mission_mate.core.designsystem.R.drawable.img_app_title), contentDescription = "rabbit", contentScale = ContentScale.FillWidth @@ -105,6 +98,7 @@ fun LoginScreen( Image( modifier = Modifier .fillMaxWidth(220f/390f) + .padding(bottom = 10.dp) .aspectRatio(1f), painter = painterResource(id = com.goalpanzi.mission_mate.core.designsystem.R.drawable.img_rabbit_default), contentDescription = "rabbit", @@ -113,9 +107,10 @@ fun LoginScreen( Box( modifier = modifier .fillMaxWidth(342f / 390f) + .wrapContentHeight() .padding(top = 175.dp) - .height(60.dp) .background(color = Color.White, shape = RoundedCornerShape(30.dp)) + .padding(horizontal = 12.dp, vertical = 6.dp) .clip(RoundedCornerShape(30.dp)) .clickable(onClick = onGoogleLoginClick), contentAlignment = Alignment.CenterStart @@ -140,13 +135,18 @@ fun LoginScreen( style = MissionMateTypography.body_sm_regular, color = ColorWhite_FFFFFFFF ) - Image( - modifier = modifier.fillMaxWidth(), - painter = painterResource(id = com.goalpanzi.mission_mate.core.designsystem.R.drawable.img_login_bottom_animals), - contentScale = ContentScale.FillWidth, - contentDescription = null - ) } + + Image( + modifier = modifier + .fillMaxWidth() + .wrapContentHeight() + .navigationBarsPadding() + .align(Alignment.BottomCenter), + painter = painterResource(id = com.goalpanzi.mission_mate.core.designsystem.R.drawable.img_login_bottom_animals), + contentScale = ContentScale.FillWidth, + contentDescription = null + ) } } diff --git a/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavHost.kt b/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavHost.kt index 44c3aeb1..0da2c7fc 100644 --- a/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavHost.kt +++ b/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavHost.kt @@ -16,7 +16,6 @@ import com.goalpanzi.mission_mate.feature.onboarding.boardSetupSuccessNavGraph import com.goalpanzi.mission_mate.feature.onboarding.invitationCodeNavGraph import com.goalpanzi.mission_mate.feature.onboarding.onboardingNavGraph import com.luckyoct.feature.profile.profileNavGraph -import com.luckyoct.feature.setting.navigation.inquiryNavGraph import com.luckyoct.feature.setting.navigation.privacyPolicyNavGraph import com.luckyoct.feature.setting.navigation.servicePolicyNavGraph import com.luckyoct.feature.setting.navigation.settingNavGraph @@ -80,9 +79,6 @@ internal fun MainNavHost( onClickPrivacyPolicy = { navigator.navigationToPrivacyPolicy() }, onClickLogout = { navigator.navigateToLogin() } ) - inquiryNavGraph( - onBackClick = { navigator.popBackStack() } - ) servicePolicyNavGraph( onBackClick = { navigator.popBackStack() } ) diff --git a/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavigator.kt b/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavigator.kt index 4900da02..f034282e 100644 --- a/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavigator.kt +++ b/feature/main/src/main/java/com/goalpanzi/mission_mate/core/main/component/MainNavigator.kt @@ -2,8 +2,8 @@ package com.goalpanzi.mission_mate.core.main.component import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.lifecycle.Lifecycle import androidx.navigation.NavHostController -import androidx.navigation.NavOptions import androidx.navigation.compose.rememberNavController import com.goalpanzi.mission_mate.core.navigation.RouteModel import com.goalpanzi.mission_mate.feature.board.navigateToBoard @@ -14,7 +14,6 @@ import com.goalpanzi.mission_mate.feature.onboarding.navigateToInvitationCode import com.goalpanzi.mission_mate.feature.onboarding.navigateToOnboarding import com.luckyoct.feature.profile.navigateToProfileCreate import com.luckyoct.feature.profile.navigateToProfileSetting -import com.luckyoct.feature.setting.navigation.navigateToInquiry import com.luckyoct.feature.setting.navigation.navigateToPrivacyPolicy import com.luckyoct.feature.setting.navigation.navigateToServicePolicy import com.luckyoct.feature.setting.navigation.navigateToSetting @@ -23,11 +22,10 @@ class MainNavigator( val navController: NavHostController ) { - //TODO : change to Main - val startDestination = RouteModel.Login - fun popBackStack() { - navController.popBackStack() + if (navController.currentBackStackEntry?.lifecycle?.currentState == Lifecycle.State.RESUMED) { + navController.popBackStack() + } } fun navigateToLogin() { diff --git a/feature/profile/src/main/java/com/luckyoct/feature/profile/ProfileNavigation.kt b/feature/profile/src/main/java/com/luckyoct/feature/profile/ProfileNavigation.kt index 0741d032..571b6c9a 100644 --- a/feature/profile/src/main/java/com/luckyoct/feature/profile/ProfileNavigation.kt +++ b/feature/profile/src/main/java/com/luckyoct/feature/profile/ProfileNavigation.kt @@ -1,5 +1,7 @@ package com.luckyoct.feature.profile +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable @@ -21,12 +23,20 @@ fun NavGraphBuilder.profileNavGraph( onSaveSuccess: () -> Unit, onBackClick: () -> Unit ) { - composable { - ProfileRoute( - profileSettingType = ProfileSettingType.CREATE, - onSaveSuccess = onSaveSuccess - ) - } + composable( + enterTransition = { + slideIntoContainer( + towards = AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(300) + ) + }, + content = { + ProfileRoute( + profileSettingType = ProfileSettingType.CREATE, + onSaveSuccess = onSaveSuccess + ) + } + ) composable { ProfileRoute( profileSettingType = ProfileSettingType.SETTING, diff --git a/feature/setting/src/main/java/com/luckyoct/feature/setting/navigation/SettingNavigation.kt b/feature/setting/src/main/java/com/luckyoct/feature/setting/navigation/SettingNavigation.kt index e454eaf8..f0c5d21c 100644 --- a/feature/setting/src/main/java/com/luckyoct/feature/setting/navigation/SettingNavigation.kt +++ b/feature/setting/src/main/java/com/luckyoct/feature/setting/navigation/SettingNavigation.kt @@ -1,5 +1,13 @@ package com.luckyoct.feature.setting.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition +import androidx.compose.animation.core.tween +import androidx.compose.animation.fadeIn +import androidx.compose.animation.fadeOut +import androidx.compose.animation.scaleIn +import androidx.compose.animation.scaleOut import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable @@ -12,10 +20,6 @@ fun NavController.navigateToSetting() { this.navigate(RouteModel.Setting) } -fun NavController.navigateToInquiry() { - this.navigate(SettingRouteModel.Inquiry) -} - fun NavController.navigateToServicePolicy() { this.navigate(SettingRouteModel.ServicePolicy) } @@ -31,26 +35,23 @@ fun NavGraphBuilder.settingNavGraph( onClickPrivacyPolicy: () -> Unit, onClickLogout: () -> Unit ) { - composable { - SettingRoute( - onBackClick = onBackClick, - onClickProfileSetting = onClickProfileSetting, - onClickServicePolicy = onClickServicePolicy, - onClickPrivacyPolicy = onClickPrivacyPolicy, - onLogout = onClickLogout - ) - } -} - -fun NavGraphBuilder.inquiryNavGraph( - onBackClick: () -> Unit -) { - composable { - WebViewScreen( - onBackClick = onBackClick, - url = "https://www.google.com/" - ) - } + composable( + enterTransition = { + slideIntoContainer( + towards = AnimatedContentTransitionScope.SlideDirection.Start, + animationSpec = tween(300) + ) + }, + popEnterTransition = null, + content = { + SettingRoute( + onBackClick = onBackClick, + onClickProfileSetting = onClickProfileSetting, + onClickServicePolicy = onClickServicePolicy, + onClickPrivacyPolicy = onClickPrivacyPolicy, + onLogout = onClickLogout + ) + }) } fun NavGraphBuilder.servicePolicyNavGraph( diff --git a/feature/setting/src/main/java/com/luckyoct/feature/setting/screen/SettingScreen.kt b/feature/setting/src/main/java/com/luckyoct/feature/setting/screen/SettingScreen.kt index a7434a18..5ce828db 100644 --- a/feature/setting/src/main/java/com/luckyoct/feature/setting/screen/SettingScreen.kt +++ b/feature/setting/src/main/java/com/luckyoct/feature/setting/screen/SettingScreen.kt @@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.width @@ -108,6 +109,7 @@ fun SettingScreen( .fillMaxSize() .background(ColorWhite_FFFFFFFF) .statusBarsPadding() + .navigationBarsPadding() ) { MissionMateTopAppBar( navigationType = NavigationType.BACK,