Improve animations for predictive back
This commit is contained in:
parent
380280686a
commit
13962a11d7
1 changed files with 3 additions and 8 deletions
|
@ -8,12 +8,11 @@ import androidx.annotation.StringRes
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import androidx.compose.animation.AnimatedContentTransitionScope
|
import androidx.compose.animation.AnimatedContentTransitionScope
|
||||||
import androidx.compose.animation.EnterTransition
|
|
||||||
import androidx.compose.animation.core.EaseIn
|
import androidx.compose.animation.core.EaseIn
|
||||||
import androidx.compose.animation.core.LinearEasing
|
import androidx.compose.animation.core.LinearEasing
|
||||||
import androidx.compose.animation.core.tween
|
import androidx.compose.animation.core.tween
|
||||||
import androidx.compose.animation.fadeIn
|
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.Icons
|
||||||
import androidx.compose.material.icons.automirrored.filled.Help
|
import androidx.compose.material.icons.automirrored.filled.Help
|
||||||
import androidx.compose.material.icons.filled.Edit
|
import androidx.compose.material.icons.filled.Edit
|
||||||
|
@ -108,13 +107,9 @@ class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsRes
|
||||||
towards = AnimatedContentTransitionScope.SlideDirection.Start
|
towards = AnimatedContentTransitionScope.SlideDirection.Start
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
popEnterTransition = { EnterTransition.None },
|
popEnterTransition = { fadeIn() },
|
||||||
popExitTransition = {
|
popExitTransition = {
|
||||||
fadeOut(
|
scaleOut(targetScale = 0.9f) + slideOutOfContainer(
|
||||||
animationSpec = tween(
|
|
||||||
300, easing = LinearEasing
|
|
||||||
)
|
|
||||||
) + slideOutOfContainer(
|
|
||||||
animationSpec = tween(300, easing = EaseIn),
|
animationSpec = tween(300, easing = EaseIn),
|
||||||
towards = AnimatedContentTransitionScope.SlideDirection.End
|
towards = AnimatedContentTransitionScope.SlideDirection.End
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue