From d00043edda5e71bd301e9767e7377a52668c764c Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Mon, 22 Jul 2024 15:50:47 +0900 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20navigation=20=EB=B2=84=EC=A0=84=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../withpeace/feature/home/navigation/HomeNavigation.kt | 5 +++-- .../withpeace/feature/mypage/navigation/MyPageNavigation.kt | 4 +++- .../feature/postlist/navigation/PostListNavigation.kt | 4 +++- gradle/libs.versions.toml | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt index c2bc6397..2068780c 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt @@ -4,7 +4,6 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions import androidx.navigation.compose.composable -import com.withpeace.withpeace.feature.home.uistate.YouthPolicyUiModel import com.withpeace.withpeace.feature.home.HomeRoute const val HOME_ROUTE = "homeRoute" @@ -17,7 +16,9 @@ fun NavGraphBuilder.homeNavGraph( onShowSnackBar: (message: String) -> Unit, onPolicyClick: (String) -> Unit, ) { - composable(route = HOME_ROUTE) { + composable( + route = HOME_ROUTE, + ) { HomeRoute( onShowSnackBar = onShowSnackBar, onPolicyClick = onPolicyClick diff --git a/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt b/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt index 2455ade0..b0d03c1e 100644 --- a/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt +++ b/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt @@ -24,7 +24,9 @@ fun NavGraphBuilder.myPageNavGraph( onAuthExpired: () -> Unit, onDibsOfPolicyClick: () -> Unit, ) { - composable(route = MY_PAGE_ROUTE) { + composable( + route = MY_PAGE_ROUTE, + ) { val nickname = it.savedStateHandle.get(MY_PAGE_CHANGED_NICKNAME_ARGUMENT) val profile = it.savedStateHandle.get(MY_PAGE_CHANGED_IMAGE_ARGUMENT) val viewModel: MyPageViewModel = hiltViewModel() diff --git a/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt b/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt index be696b7f..3b16b5fb 100644 --- a/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt +++ b/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt @@ -19,7 +19,9 @@ fun NavGraphBuilder.postListGraph( navigateToPostDetail: (postId: Long) -> Unit, onAuthExpired: () -> Unit, ) { - composable(POST_LIST_ROUTE) { + composable( + route = POST_LIST_ROUTE, + ) { val deletedId = it.savedStateHandle.get(POST_LIST_DELETED_POST_ID_ARGUMENT) val viewModel: PostListViewModel = hiltViewModel() deletedId?.let { id -> diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0ed740bb..86282654 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ androidxAppCompat = "1.6.1" androidxLifecycle = "2.7.0" androidxComposeBom = "2024.06.00" androidxComposeCompiler = "1.5.1" -androidxComposeNavigation = "2.7.7" +androidxComposeNavigation = "2.8.0-beta05" composeIconExtended = "1.5.4" androidxActivity = "1.8.2" coreSplashscreen = "1.0.1" From d43ee7492a2901ec281b9c579b0107fa4f7f21d3 Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Mon, 22 Jul 2024 18:11:34 +0900 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=ED=99=94=EB=A9=B4=20=EC=A0=84?= =?UTF-8?q?=ED=99=98=20=EC=95=A0=EB=8B=88=EB=A9=94=EC=9D=B4=EC=85=98=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/release/output-metadata.json | 4 ++-- .../withpeace/withpeace/navigation/NavHost.kt | 4 ++++ .../gallery/navigation/GalleryNavigation.kt | 14 +++++++++++++ .../feature/home/navigation/HomeNavigation.kt | 4 ++++ .../mypage/navigation/MyPageNavigation.kt | 4 ++++ .../navigation/PolicyBookmarksNavigation.kt | 21 +++++++++++++++++-- .../policyconsent/PolicyConsentScreen.kt | 5 ++++- .../navigation/PolicyConsentNavigation.kt | 18 +++++++++++++++- .../policydetail/PolicyDetailScreen.kt | 2 +- .../navigation/PolicyDetailNavigation.kt | 14 +++++++++++++ .../navigation/PostDetailNavigation.kt | 6 ++++++ .../postlist/navigation/PostListNavigation.kt | 4 ++++ .../navigation/PrivacyPolicyNavigation.kt | 18 +++++++++++++++- .../app/profileeditor/ProfileEditorScreen.kt | 1 + .../navigation/ProfileEditorNavigation.kt | 14 +++++++++++++ .../navigation/RegisterPostNavigation.kt | 18 +++++++++++++++- .../signup/navigation/SignUpNavigation.kt | 18 +++++++++++++++- .../termsofservice/TermsOfServiceScreen.kt | 8 ++++++- .../navigation/TermsOfServiceNavigation.kt | 19 ++++++++++++++++- 19 files changed, 184 insertions(+), 12 deletions(-) diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index e3569d84..c3169023 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -11,8 +11,8 @@ "type": "SINGLE", "filters": [], "attributes": [], - "versionCode": 5, - "versionName": "1.0.0", + "versionCode": 9, + "versionName": "1.1.1", "outputFile": "app-release.apk" } ], diff --git a/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt b/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt index 5fadf336..e956141a 100644 --- a/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt +++ b/app/src/main/java/com/withpeace/withpeace/navigation/NavHost.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.navigation +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.navigation.NavHostController @@ -55,6 +57,8 @@ fun WithpeaceNavHost( modifier = modifier, navController = navController, startDestination = startDestination, + enterTransition = { EnterTransition.None }, + exitTransition = { ExitTransition.None }, ) { loginNavGraph( onShowSnackBar = { onShowSnackBar(SnackbarState(it)) }, diff --git a/feature/gallery/src/main/java/com/withpeace/withpeace/feature/gallery/navigation/GalleryNavigation.kt b/feature/gallery/src/main/java/com/withpeace/withpeace/feature/gallery/navigation/GalleryNavigation.kt index c6cf9476..d623f69f 100644 --- a/feature/gallery/src/main/java/com/withpeace/withpeace/feature/gallery/navigation/GalleryNavigation.kt +++ b/feature/gallery/src/main/java/com/withpeace/withpeace/feature/gallery/navigation/GalleryNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.gallery.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -32,6 +34,18 @@ fun NavGraphBuilder.galleryNavGraph( navArgument(GALLERY_IMAGE_LIMIT_ARGUMENT) { type = NavType.IntType }, navArgument(GALLERY_ALREADY_IMAGE_COUNT_ARGUMENT) { type = NavType.IntType }, ), + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, ) { GalleryRoute( onClickBackButton = onClickBackButton, diff --git a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt index 2068780c..4ec28ae6 100644 --- a/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt +++ b/feature/home/src/main/java/com/withpeace/withpeace/feature/home/navigation/HomeNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.home.navigation +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -18,6 +20,8 @@ fun NavGraphBuilder.homeNavGraph( ) { composable( route = HOME_ROUTE, + enterTransition = { EnterTransition.None }, + exitTransition = { ExitTransition.None }, ) { HomeRoute( onShowSnackBar = onShowSnackBar, diff --git a/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt b/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt index b0d03c1e..4d344ca6 100644 --- a/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt +++ b/feature/mypage/src/main/java/com/withpeace/withpeace/feature/mypage/navigation/MyPageNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.mypage.navigation +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -26,6 +28,8 @@ fun NavGraphBuilder.myPageNavGraph( ) { composable( route = MY_PAGE_ROUTE, + enterTransition = { EnterTransition.None }, + exitTransition = { ExitTransition.None }, ) { val nickname = it.savedStateHandle.get(MY_PAGE_CHANGED_NICKNAME_ARGUMENT) val profile = it.savedStateHandle.get(MY_PAGE_CHANGED_IMAGE_ARGUMENT) diff --git a/feature/policybookmarks/src/main/java/com/withpeace/withpeace/feature/policybookmarks/navigation/PolicyBookmarksNavigation.kt b/feature/policybookmarks/src/main/java/com/withpeace/withpeace/feature/policybookmarks/navigation/PolicyBookmarksNavigation.kt index 43cd46a2..c39435c8 100644 --- a/feature/policybookmarks/src/main/java/com/withpeace/withpeace/feature/policybookmarks/navigation/PolicyBookmarksNavigation.kt +++ b/feature/policybookmarks/src/main/java/com/withpeace/withpeace/feature/policybookmarks/navigation/PolicyBookmarksNavigation.kt @@ -1,3 +1,5 @@ +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -14,10 +16,25 @@ fun NavGraphBuilder.policyBookmarksNavGraph( onShowSnackBar: (message: String) -> Unit, onClickBackButton: () -> Unit, ) { - composable(route = POLICY_BOOKMARKS_ROUTE) { + composable( + route = POLICY_BOOKMARKS_ROUTE, + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, + ) { PolicyBookmarksRoute( onShowSnackBar = onShowSnackBar, onClickBackButton = onClickBackButton, - ) + + ) } } \ No newline at end of file diff --git a/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/PolicyConsentScreen.kt b/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/PolicyConsentScreen.kt index db0d7194..827db68a 100644 --- a/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/PolicyConsentScreen.kt +++ b/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/PolicyConsentScreen.kt @@ -1,6 +1,7 @@ package com.withpeace.withpeace.feature.policyconsent import androidx.compose.foundation.Image +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -90,8 +91,10 @@ fun PolicyConsentScreen( ) { val scrollState = rememberScrollState() Column( + modifier = modifier + .fillMaxSize() + .background(WithpeaceTheme.colors.SystemWhite), verticalArrangement = Arrangement.SpaceBetween, - modifier = modifier.fillMaxSize(), ) { Column( modifier diff --git a/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/navigation/PolicyConsentNavigation.kt b/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/navigation/PolicyConsentNavigation.kt index bf970bc0..3e07a59b 100644 --- a/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/navigation/PolicyConsentNavigation.kt +++ b/feature/policyconsent/src/main/java/com/withpeace/withpeace/feature/policyconsent/navigation/PolicyConsentNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.policyconsent.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -17,7 +19,21 @@ fun NavGraphBuilder.policyConsentGraph( onShowTermsOfServiceClick: () -> Unit, onSuccessToNext: () -> Unit, ) { - composable(POLICY_CONSENT_ROUTE) { + composable( + POLICY_CONSENT_ROUTE, + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, + ) { PolicyConsentRoute( onShowSnackBar = onShowSnackBar, onShowPrivacyPolicyClick = onShowPrivacyPolicyClick, diff --git a/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt b/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt index b4d1580b..4bfd816e 100644 --- a/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt +++ b/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt @@ -87,7 +87,7 @@ private fun PolicyDetailContent( scrollState.value >= position.intValue } } - Column(modifier = modifier.fillMaxSize()) { + Column(modifier = modifier.fillMaxSize().background(WithpeaceTheme.colors.SystemWhite)) { WithPeaceBackButtonTopAppBar( onClickBackButton = onClickBackButton, title = { diff --git a/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/navigation/PolicyDetailNavigation.kt b/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/navigation/PolicyDetailNavigation.kt index 9f907a35..99bf7f87 100644 --- a/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/navigation/PolicyDetailNavigation.kt +++ b/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/navigation/PolicyDetailNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.policydetail.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -30,6 +32,18 @@ fun NavGraphBuilder.policyDetailNavGraph( type = NavType.StringType }, ), + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, ) { PolicyDetailRoute( diff --git a/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt b/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt index b8a2b783..f09f83eb 100644 --- a/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt +++ b/feature/postdetail/src/main/java/com/withpeace/withpeace/feature/postdetail/navigation/PostDetailNavigation.kt @@ -39,6 +39,12 @@ fun NavGraphBuilder.postDetailGraph( animationSpec = tween(500), ) }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, ) { PostDetailRoute( onShowSnackBar = onShowSnackBar, diff --git a/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt b/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt index 3b16b5fb..2502843c 100644 --- a/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt +++ b/feature/postlist/src/main/java/com/withpeace/withpeace/feature/postlist/navigation/PostListNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.postlist.navigation +import androidx.compose.animation.EnterTransition +import androidx.compose.animation.ExitTransition import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -21,6 +23,8 @@ fun NavGraphBuilder.postListGraph( ) { composable( route = POST_LIST_ROUTE, + enterTransition = { EnterTransition.None }, + exitTransition = { ExitTransition.None }, ) { val deletedId = it.savedStateHandle.get(POST_LIST_DELETED_POST_ID_ARGUMENT) val viewModel: PostListViewModel = hiltViewModel() diff --git a/feature/privacypolicy/src/main/java/com/withpeace/withpeace/feature/privacypolicy/navigation/PrivacyPolicyNavigation.kt b/feature/privacypolicy/src/main/java/com/withpeace/withpeace/feature/privacypolicy/navigation/PrivacyPolicyNavigation.kt index 69581cd5..be5d0f18 100644 --- a/feature/privacypolicy/src/main/java/com/withpeace/withpeace/feature/privacypolicy/navigation/PrivacyPolicyNavigation.kt +++ b/feature/privacypolicy/src/main/java/com/withpeace/withpeace/feature/privacypolicy/navigation/PrivacyPolicyNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.privacypolicy.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -15,7 +17,21 @@ fun NavGraphBuilder.privacyPolicyGraph( onShowSnackBar: (String) -> Unit, onClickBackButton: () -> Unit, ) { - composable(PRIVACY_POLICY_ROUTE) { + composable( + route = PRIVACY_POLICY_ROUTE, + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, + ) { PrivacyPolicyRoute( onShowSnackBar = onShowSnackBar, onClickBackButton = onClickBackButton, diff --git a/feature/profileeditor/src/main/java/com/app/profileeditor/ProfileEditorScreen.kt b/feature/profileeditor/src/main/java/com/app/profileeditor/ProfileEditorScreen.kt index 7d21a5c2..c8e40501 100644 --- a/feature/profileeditor/src/main/java/com/app/profileeditor/ProfileEditorScreen.kt +++ b/feature/profileeditor/src/main/java/com/app/profileeditor/ProfileEditorScreen.kt @@ -142,6 +142,7 @@ fun ProfileEditorScreen( verticalArrangement = Arrangement.SpaceBetween, modifier = modifier .fillMaxSize() + .background(WithpeaceTheme.colors.SystemWhite) .verticalScroll(rememberScrollState()) .padding(top = 0.dp), ) { diff --git a/feature/profileeditor/src/main/java/com/app/profileeditor/navigation/ProfileEditorNavigation.kt b/feature/profileeditor/src/main/java/com/app/profileeditor/navigation/ProfileEditorNavigation.kt index 0e683b7b..380abcaf 100644 --- a/feature/profileeditor/src/main/java/com/app/profileeditor/navigation/ProfileEditorNavigation.kt +++ b/feature/profileeditor/src/main/java/com/app/profileeditor/navigation/ProfileEditorNavigation.kt @@ -1,5 +1,7 @@ package com.app.profileeditor.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -41,6 +43,18 @@ fun NavGraphBuilder.profileEditorNavGraph( navArgument(PROFILE_NICKNAME_ARGUMENT) { type = NavType.StringType }, navArgument(PROFILE_IMAGE_URL_ARGUMENT) { type = NavType.StringType }, ), + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, ) { entry -> val selectedImageUri = entry.savedStateHandle.get>(IMAGE_LIST_ARGUMENT) ?: emptyList() diff --git a/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/navigation/RegisterPostNavigation.kt b/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/navigation/RegisterPostNavigation.kt index 16c11be9..4d19dec0 100644 --- a/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/navigation/RegisterPostNavigation.kt +++ b/feature/registerpost/src/main/java/com/withpeace/withpeace/feature/registerpost/navigation/RegisterPostNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.registerpost.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -25,7 +27,21 @@ fun NavGraphBuilder.registerPostNavGraph( originPost: RegisterPostUiModel?, onAuthExpired: () -> Unit, ) { - composable(route = REGISTER_POST_ROUTE) { entry -> + composable( + route = REGISTER_POST_ROUTE, + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Up, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Down, + animationSpec = tween(500), + ) + }, + ) { entry -> val viewModel: RegisterPostViewModel = hiltViewModel() viewModel.initRegisterPost(originPost) diff --git a/feature/signup/src/main/java/com/withpeace/withpeace/feature/signup/navigation/SignUpNavigation.kt b/feature/signup/src/main/java/com/withpeace/withpeace/feature/signup/navigation/SignUpNavigation.kt index cdf5712e..7aa05c64 100644 --- a/feature/signup/src/main/java/com/withpeace/withpeace/feature/signup/navigation/SignUpNavigation.kt +++ b/feature/signup/src/main/java/com/withpeace/withpeace/feature/signup/navigation/SignUpNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.signup.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.hilt.navigation.compose.hiltViewModel import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder @@ -20,7 +22,21 @@ fun NavGraphBuilder.signUpNavGraph( onNavigateToGallery: () -> Unit, onSignUpSuccess: () -> Unit, ) { - composable(route = SIGN_UP_ROUTE) { entry -> + composable( + route = SIGN_UP_ROUTE, + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + }, + ) { entry -> val selectedImageUri = entry.savedStateHandle.get>(IMAGE_LIST_ARGUMENT) ?: emptyList() val viewModel: SignUpViewModel = hiltViewModel() diff --git a/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/TermsOfServiceScreen.kt b/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/TermsOfServiceScreen.kt index 18d6f59c..f51d4dd9 100644 --- a/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/TermsOfServiceScreen.kt +++ b/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/TermsOfServiceScreen.kt @@ -1,6 +1,8 @@ package com.withpeace.withpeace.feature.termsofservice +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -24,7 +26,11 @@ fun TermsOfServiceScreen( modifier: Modifier = Modifier, onClickBackButton: () -> Unit, ) { - Column { + Column( + modifier = modifier + .fillMaxSize() + .background(WithpeaceTheme.colors.SystemWhite), + ) { WithPeaceBackButtonTopAppBar( onClickBackButton = onClickBackButton, title = { diff --git a/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/navigation/TermsOfServiceNavigation.kt b/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/navigation/TermsOfServiceNavigation.kt index 96c79098..41a1394b 100644 --- a/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/navigation/TermsOfServiceNavigation.kt +++ b/feature/termsofservice/src/main/java/com/withpeace/withpeace/feature/termsofservice/navigation/TermsOfServiceNavigation.kt @@ -1,5 +1,7 @@ package com.withpeace.withpeace.feature.termsofservice.navigation +import androidx.compose.animation.AnimatedContentTransitionScope +import androidx.compose.animation.core.tween import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.NavOptions @@ -15,7 +17,22 @@ fun NavGraphBuilder.termsOfServiceGraph( onShowSnackBar: (String) -> Unit, onClickBackButton: () -> Unit, ) { - composable(TERMS_OF_SERVICE_ROUTE) { + composable( + route = TERMS_OF_SERVICE_ROUTE, + enterTransition = { + slideIntoContainer( + AnimatedContentTransitionScope.SlideDirection.Left, + animationSpec = tween(500), + ) + }, + exitTransition = { + slideOutOfContainer( + AnimatedContentTransitionScope.SlideDirection.Right, + animationSpec = tween(500), + ) + + }, + ) { TermsOfServiceRoute( onShowSnackBar = onShowSnackBar, From bd08f8ae298806981d74fccb4633c790c39e140f Mon Sep 17 00:00:00 2001 From: kwakjoohyeong Date: Mon, 22 Jul 2024 18:20:26 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=EC=A0=95=EC=B1=85=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=ED=99=94=EB=A9=B4=20=ED=83=80=EC=9D=B4=ED=8B=80=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=A1=A4=20=EB=AC=B8=EC=A0=9C=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 애니메이션 변경시 타이틀이 깜빡거림 --- .../withpeace/feature/policydetail/PolicyDetailScreen.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt b/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt index 4bfd816e..3ffeca04 100644 --- a/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt +++ b/feature/policydetail/src/main/java/com/withpeace/withpeace/feature/policydetail/PolicyDetailScreen.kt @@ -84,10 +84,12 @@ private fun PolicyDetailContent( } val visibility = remember { derivedStateOf { - scrollState.value >= position.intValue + scrollState.value > position.intValue } } - Column(modifier = modifier.fillMaxSize().background(WithpeaceTheme.colors.SystemWhite)) { + Column(modifier = modifier + .fillMaxSize() + .background(WithpeaceTheme.colors.SystemWhite)) { WithPeaceBackButtonTopAppBar( onClickBackButton = onClickBackButton, title = { @@ -103,6 +105,7 @@ private fun PolicyDetailContent( overflow = TextOverflow.Ellipsis, modifier = modifier.padding(end = 24.dp), ) + } }, )