From ee585feaa6d053575d177380798e2c8e42c0cc6a Mon Sep 17 00:00:00 2001 From: Tram Bui Date: Thu, 7 Nov 2024 14:27:50 -0800 Subject: [PATCH 1/3] add in new animations for pb NavHost and update the activity and nav dependencies --- .../com/google/android/samples/socialite/ui/Main.kt | 13 +++++++++---- gradle/libs.versions.toml | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt b/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt index 6f923a8c..7b9c5c1c 100644 --- a/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt +++ b/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt @@ -20,6 +20,7 @@ import android.app.Activity import android.content.Intent import android.content.pm.ActivityInfo import android.os.Bundle +import androidx.compose.animation.EnterTransition import androidx.compose.animation.core.FastOutLinearInEasing import androidx.compose.animation.core.FastOutSlowInEasing import androidx.compose.animation.core.tween @@ -30,6 +31,7 @@ import androidx.compose.animation.scaleOut import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.TransformOrigin import androidx.compose.ui.platform.LocalContext import androidx.navigation.NavController import androidx.navigation.NavDestination @@ -82,11 +84,14 @@ fun MainNavigation( NavHost( navController = navController, startDestination = "home", - popEnterTransition = { - scaleIn(initialScale = 1.1F) + fadeIn() - }, popExitTransition = { - scaleOut(targetScale = 0.9F) + fadeOut() + scaleOut( + targetScale = 0.9f, + transformOrigin = TransformOrigin(pivotFractionX = 0.5f, pivotFractionY = 0.5f), + ) + }, + popEnterTransition = { + EnterTransition.None }, modifier = modifier, ) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 96fec81f..e757795d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ [versions] accompanist = "0.32.0" -activity = "1.9.0-rc01" +activity = "1.9.3" agp = "8.2.2" benchmarkMacroJunit4 = "1.2.3" baselineprofile = "1.2.3" @@ -37,7 +37,7 @@ ksp = "1.9.20-1.0.14" lifecycle = "2.7.0" material3 = "1.2.1" media3 = "1.4.0-rc01" -navigation = "2.8.0-alpha07" +navigation = "2.8.3" profileinstaller = "1.3.1" room = "2.6.1" spotless = "6.24.0" From 2d2f5082e4aa1ec92b2bb564347d1b1a0600bbe3 Mon Sep 17 00:00:00 2001 From: Tram Bui Date: Thu, 7 Nov 2024 14:37:46 -0800 Subject: [PATCH 2/3] update other alpha dependencies to stable versions --- gradle/libs.versions.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e757795d..3de87f20 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -28,26 +28,26 @@ concurrent = "1.1.0" core = "1.12.0" core-splashscreen = "1.0.1" espresso = "3.5.1" -graphics = "1.0.0-alpha05" +graphics = "1.0.1" hilt = "2.49" hiltNavigationCompose = "1.2.0" junit = "4.13.2" kotlin = "1.9.20" ksp = "1.9.20-1.0.14" lifecycle = "2.7.0" -material3 = "1.2.1" +material3 = "1.3.1" media3 = "1.4.0-rc01" navigation = "2.8.3" -profileinstaller = "1.3.1" +profileinstaller = "1.4.1" room = "2.6.1" spotless = "6.24.0" -test = "1.1.5" +test = "1.2.1" truth = "1.1.3" turbine = "1.0.0" uiautomator = "2.3.0" window = "1.2.0" -material3-adaptive-navigation-suite = "1.0.0-alpha05" -glance = "1.1.0-alpha01" +material3-adaptive-navigation-suite = "1.3.1" +glance = "1.1.1" secrets = "2.0.1" generativeai = "0.7.0" datastore = "1.0.0" From 1b84375e03a1ea48ac92530845844a89043e0548 Mon Sep 17 00:00:00 2001 From: Tram Bui Date: Thu, 7 Nov 2024 14:44:29 -0800 Subject: [PATCH 3/3] fix spotlessApply error --- .../main/java/com/google/android/samples/socialite/ui/Main.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt b/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt index 7b9c5c1c..dcce7bc7 100644 --- a/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt +++ b/app/src/main/java/com/google/android/samples/socialite/ui/Main.kt @@ -26,7 +26,6 @@ import androidx.compose.animation.core.FastOutSlowInEasing 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.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable