Skip to content

Commit

Permalink
add back in predictive back animations (#118)
Browse files Browse the repository at this point in the history
* add back in predictive back animations

* spotless apply
  • Loading branch information
ashnohe authored Dec 17, 2024
1 parent b5166a1 commit cbff314
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/com/google/android/samples/socialite/ui/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ 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
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
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
Expand Down Expand Up @@ -88,6 +91,15 @@ fun MainNavigation(
NavHost(
navController = navController,
startDestination = Route.ChatsList,
popExitTransition = {
scaleOut(
targetScale = 0.9f,
transformOrigin = TransformOrigin(pivotFractionX = 0.5f, pivotFractionY = 0.5f),
)
},
popEnterTransition = {
EnterTransition.None
},
) {
composable<Route.ChatsList> {
ChatList(
Expand Down

0 comments on commit cbff314

Please sign in to comment.