From 276f72733eb50201f2cb1193cc57936d390bccf1 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 23 Oct 2026 03:21:35 +0000 Subject: [PATCH] app: use standard horizontal slide transitions Configure NavDisplay with standard horizontal slide transitions for forward, pop, and predictive back navigation, following the layout direction, and wrap the root content in a Surface to prevent window background bleed. Assisted-by: Gemini 4 Argon Assisted-by: Claude Opus 5.5 --- .../com/topjohnwu/magisk/ui/MainActivity.kt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt index 21b24d70c..149f5c6f9 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/MainActivity.kt @@ -13,8 +13,10 @@ import android.os.CancellationSignal import android.provider.OpenableColumns import androidx.activity.ComponentActivity import androidx.activity.compose.setContent -import androidx.compose.foundation.layout.Box +import androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection +import androidx.compose.animation.togetherWith import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.material3.Surface import androidx.compose.runtime.Composable import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.LaunchedEffect @@ -118,7 +120,7 @@ class MainActivity : ComponentActivity(), SplashScreenHost { setContent { MagiskTheme { - Box(modifier = Modifier.fillMaxSize()) { + Surface(modifier = Modifier.fillMaxSize()) { val navigator = rememberNavigator(Route.Main) CompositionLocalProvider(LocalNavigator provides navigator) { HandleFlashIntent(navigator) @@ -130,6 +132,19 @@ class MainActivity : ComponentActivity(), SplashScreenHost { rememberSaveableStateHolderNavEntryDecorator(), rememberViewModelStoreNavEntryDecorator() ), + // Start/End follow the layout direction, so RTL slides the other way + transitionSpec = { + slideIntoContainer(SlideDirection.Start) togetherWith + slideOutOfContainer(SlideDirection.Start) + }, + popTransitionSpec = { + slideIntoContainer(SlideDirection.End) togetherWith + slideOutOfContainer(SlideDirection.End) + }, + predictivePopTransitionSpec = { + slideIntoContainer(SlideDirection.End) togetherWith + slideOutOfContainer(SlideDirection.End) + }, entryProvider = entryProvider { entry { val superuserVm: SuperuserViewModel = viewModel(