Skip to content

Commit 764a75f

Browse files
authoredFeb 20, 2025
[JetCaster] enable predictive back animations and add in pb NavHost animations (android#1533)
Add predictive back animations (back-to-home) and in-app animations to JetCaster https://github.com/user-attachments/assets/3649450c-46a5-4c43-82f6-63ba9d4b4bbe
2 parents a64d502 + e0cd82a commit 764a75f

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)