Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into feature/fix-navigation
Browse files Browse the repository at this point in the history
# Conflicts:
#	feature/login/src/main/java/com/goalpanzi/mission_mate/feature/login/LoginNavigation.kt
#	feature/profile/src/main/java/com/luckyoct/feature/profile/ProfileNavigation.kt
#	feature/setting/src/main/java/com/luckyoct/feature/setting/navigation/SettingNavigation.kt
  • Loading branch information
eshc123 committed Aug 14, 2024
2 parents 5263970 + 6558937 commit e5089e6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ sealed interface OnboardingRouteModel {

sealed interface SettingRouteModel {

@Serializable
data object Inquiry : SettingRouteModel

@Serializable
data object ServicePolicy : SettingRouteModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ fun LoginScreen(
modifier = modifier
.fillMaxSize()
.navigationBarsPadding()
.background(color = Color_FFFF5632)
.statusBarsPadding(),
.background(color = Color_FFFF5632),
horizontalAlignment = Alignment.CenterHorizontally
) {
Image(
Expand Down Expand Up @@ -145,7 +144,7 @@ fun LoginScreen(
.navigationBarsPadding()
.align(Alignment.BottomCenter),
painter = painterResource(id = com.goalpanzi.mission_mate.core.designsystem.R.drawable.img_login_bottom_animals),
contentScale = ContentScale.FillBounds,
contentScale = ContentScale.FillWidth,
contentDescription = null
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,9 +79,6 @@ internal fun MainNavHost(
onClickPrivacyPolicy = { navigator.navigationToPrivacyPolicy() },
onClickLogout = { navigator.navigateToLogin() }
)
inquiryNavGraph(
onBackClick = { navigator.popBackStack() }
)
servicePolicyNavGraph(
onBackClick = { navigator.popBackStack() }
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,7 +23,14 @@ fun NavGraphBuilder.profileNavGraph(
onSaveSuccess: () -> Unit,
onBackClick: () -> Unit
) {
composable("RouteModel.Profile.Create") {
composable("RouteModel.Profile.Create",
enterTransition = {
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Left,
animationSpec = tween(300)
)
}
) {
ProfileRoute(
profileSettingType = ProfileSettingType.CREATE,
onSaveSuccess = onSaveSuccess
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,7 +39,15 @@ fun NavGraphBuilder.settingNavGraph(
onClickPrivacyPolicy: () -> Unit,
onClickLogout: () -> Unit
) {
composable("RouteModel.Setting") {
composable("RouteModel.Setting",
enterTransition = {
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Start,
animationSpec = tween(300)
)
},
popEnterTransition = null,
) {
SettingRoute(
onBackClick = onBackClick,
onClickProfileSetting = onClickProfileSetting,
Expand All @@ -42,16 +58,6 @@ fun NavGraphBuilder.settingNavGraph(
}
}

fun NavGraphBuilder.inquiryNavGraph(
onBackClick: () -> Unit
) {
composable("SettingRouteModel.Inquiry") {
WebViewScreen(
onBackClick = onBackClick,
url = "https://www.google.com/"
)
}
}

fun NavGraphBuilder.servicePolicyNavGraph(
onBackClick: () -> Unit
Expand Down

0 comments on commit e5089e6

Please sign in to comment.