Skip to content

Commit e0cd82a

Browse files
committedFeb 13, 2025
enable predictive back animations and add in pb NavHost animations
1 parent 63210a3 commit e0cd82a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎Jetcaster/mobile/src/main/AndroidManifest.xml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
android:label="@string/app_name"
2929
android:supportsRtl="true"
3030
android:theme="@style/Theme.Jetcaster"
31+
android:enableOnBackInvokedCallback="true"
3132
android:usesCleartextTraffic="true">
3233

3334
<activity

‎Jetcaster/mobile/src/main/java/com/example/jetcaster/ui/JetcasterApp.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package com.example.jetcaster.ui
1818

19+
import androidx.compose.animation.EnterTransition
20+
import androidx.compose.animation.scaleOut
1921
import androidx.compose.material3.AlertDialog
2022
import androidx.compose.material3.Text
2123
import androidx.compose.material3.TextButton
@@ -40,7 +42,9 @@ fun JetcasterApp(
4042
if (appState.isOnline) {
4143
NavHost(
4244
navController = appState.navController,
43-
startDestination = Screen.Home.route
45+
startDestination = Screen.Home.route,
46+
popExitTransition = { scaleOut(targetScale = 0.9f) },
47+
popEnterTransition = { EnterTransition.None }
4448
) {
4549
composable(Screen.Home.route) { backStackEntry ->
4650
MainScreen(

0 commit comments

Comments
 (0)
Please sign in to comment.