0
0
mirror of https://github.com/florisboard/florisboard.git synced 2024-09-19 19:42:20 +02:00

Switch to sliding navigation animation (#2527)

This commit is contained in:
Lars Mühlbauer 2024-08-13 21:13:11 +02:00 committed by GitHub
parent c5ee414ec6
commit 199211fdbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View File

@ -42,10 +42,11 @@
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/floris_app_icon"
android:label="@string/floris_app_name"
android:enableOnBackInvokedCallback="true"
android:roundIcon="@mipmap/floris_app_icon_round"
android:supportsRtl="true"
android:theme="@style/FlorisAppTheme"
tools:targetApi="s">
tools:targetApi="tiramisu">
<!-- Allow app to be profiled for benchmarking and baseline profile generation -->
<profileable android:shell="true"/>

View File

@ -17,8 +17,13 @@
package dev.patrickgold.florisboard.app
import androidx.compose.animation.AnimatedContentScope
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.slideIn
import androidx.compose.animation.slideOut
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.IntOffset
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
@ -174,6 +179,18 @@ object Routes {
modifier = modifier,
navController = navController,
startDestination = startDestination,
enterTransition = {
slideIn { IntOffset(it.width, 0) } + fadeIn()
},
exitTransition = {
slideOut { IntOffset(-it.width, 0) } + fadeOut()
},
popEnterTransition = {
slideIn { IntOffset(-it.width, 0) } + fadeIn()
},
popExitTransition = {
slideOut { IntOffset(it.width, 0) } + fadeOut()
}
) {
composable(Setup.Screen) { SetupScreen() }