Skip to content

Commit

Permalink
Merge pull request #31 from Nexters/feature/fix-ready-to-mvp
Browse files Browse the repository at this point in the history
MVP 배포 전 이슈 수정
  • Loading branch information
eshc123 authored Aug 14, 2024
2 parents 0801ec2 + 7912d6b commit 6558937
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 65 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
isDebuggable = false
}
}
buildFeatures {
Expand Down
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 @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -76,24 +70,23 @@ 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"
)

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
Expand All @@ -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",
Expand All @@ -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
Expand All @@ -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
)
}
}

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,12 +23,20 @@ fun NavGraphBuilder.profileNavGraph(
onSaveSuccess: () -> Unit,
onBackClick: () -> Unit
) {
composable<RouteModel.Profile.Create> {
ProfileRoute(
profileSettingType = ProfileSettingType.CREATE,
onSaveSuccess = onSaveSuccess
)
}
composable<RouteModel.Profile.Create>(
enterTransition = {
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Left,
animationSpec = tween(300)
)
},
content = {
ProfileRoute(
profileSettingType = ProfileSettingType.CREATE,
onSaveSuccess = onSaveSuccess
)
}
)
composable<RouteModel.Profile.Setting> {
ProfileRoute(
profileSettingType = ProfileSettingType.SETTING,
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 All @@ -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)
}
Expand All @@ -31,26 +35,23 @@ fun NavGraphBuilder.settingNavGraph(
onClickPrivacyPolicy: () -> Unit,
onClickLogout: () -> Unit
) {
composable<RouteModel.Setting> {
SettingRoute(
onBackClick = onBackClick,
onClickProfileSetting = onClickProfileSetting,
onClickServicePolicy = onClickServicePolicy,
onClickPrivacyPolicy = onClickPrivacyPolicy,
onLogout = onClickLogout
)
}
}

fun NavGraphBuilder.inquiryNavGraph(
onBackClick: () -> Unit
) {
composable<SettingRouteModel.Inquiry> {
WebViewScreen(
onBackClick = onBackClick,
url = "https://www.google.com/"
)
}
composable<RouteModel.Setting>(
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -108,6 +109,7 @@ fun SettingScreen(
.fillMaxSize()
.background(ColorWhite_FFFFFFFF)
.statusBarsPadding()
.navigationBarsPadding()
) {
MissionMateTopAppBar(
navigationType = NavigationType.BACK,
Expand Down

0 comments on commit 6558937

Please sign in to comment.