From 13962a11d727bc3ca3daded2c1d9b471b127e9fd Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 6 Nov 2024 21:01:36 -0700 Subject: [PATCH] Improve animations for predictive back --- .../java/com/wbrawner/simplemarkdown/MainActivity.kt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/MainActivity.kt b/app/src/main/java/com/wbrawner/simplemarkdown/MainActivity.kt index 406123b..8516083 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/MainActivity.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/MainActivity.kt @@ -8,12 +8,11 @@ import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate import androidx.compose.animation.AnimatedContentTransitionScope -import androidx.compose.animation.EnterTransition import androidx.compose.animation.core.EaseIn import androidx.compose.animation.core.LinearEasing import androidx.compose.animation.core.tween import androidx.compose.animation.fadeIn -import androidx.compose.animation.fadeOut +import androidx.compose.animation.scaleOut import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.Help import androidx.compose.material.icons.filled.Edit @@ -108,13 +107,9 @@ class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsRes towards = AnimatedContentTransitionScope.SlideDirection.Start ) }, - popEnterTransition = { EnterTransition.None }, + popEnterTransition = { fadeIn() }, popExitTransition = { - fadeOut( - animationSpec = tween( - 300, easing = LinearEasing - ) - ) + slideOutOfContainer( + scaleOut(targetScale = 0.9f) + slideOutOfContainer( animationSpec = tween(300, easing = EaseIn), towards = AnimatedContentTransitionScope.SlideDirection.End )