From 0308a9d3962d18588d12af77194ce76d9ae053f4 Mon Sep 17 00:00:00 2001 From: HapeLee <63206378+HapeLee@users.noreply.github.com> Date: Mon, 11 May 2026 04:09:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9F=90=E4=BA=9B=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E9=94=99=E8=AF=AF=E5=BA=94=E7=94=A8=E6=B7=A1=E5=85=A5?= =?UTF-8?q?=E6=B7=A1=E5=87=BA=E5=8A=A8=E7=94=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/main/MainActivity.kt | 47 +++++++------------ 1 file changed, 17 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 18d19fb26..adcec733e 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -609,18 +609,7 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback { ) } - entry( - metadata = NavDisplay.transitionSpec { - fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) - } + NavDisplay.popTransitionSpec { - fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) - } + NavDisplay.predictivePopTransitionSpec { _ -> - fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) - } - ) { route -> + entry { route -> val searchViewModel = koinViewModel() LaunchedEffect(route.key, route.scopeRaw, searchViewModel) { @@ -697,19 +686,28 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback { entry( metadata = NavDisplay.transitionSpec { - if (initialState.key is MainRouteExploreShow) { + val from = initialState.key + val fromStr = from.toString() + if (from is MainRouteHome || from is MainRouteExploreShow || from is MainRouteSearch || + fromStr.startsWith("MainRouteHome") || fromStr.startsWith("MainRouteExploreShow") || fromStr.startsWith("MainRouteSearch")) { fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) + fadeOut(animationSpec = tween(300)) } else null } + NavDisplay.popTransitionSpec { - if (targetState.key is MainRouteExploreShow) { + val to = targetState.key + val toStr = to.toString() + if (to is MainRouteHome || to is MainRouteExploreShow || to is MainRouteSearch || + toStr.startsWith("MainRouteHome") || toStr.startsWith("MainRouteExploreShow") || toStr.startsWith("MainRouteSearch")) { fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) + fadeOut(animationSpec = tween(300)) } else null } + NavDisplay.predictivePopTransitionSpec { _ -> - if (targetState.key is MainRouteExploreShow) { + val to = targetState.key + val toStr = to.toString() + if (to is MainRouteHome || to is MainRouteExploreShow || to is MainRouteSearch || + toStr.startsWith("MainRouteHome") || toStr.startsWith("MainRouteExploreShow") || toStr.startsWith("MainRouteSearch")) { fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) + fadeOut(animationSpec = tween(300)) } else null } ) { route -> @@ -731,18 +729,7 @@ open class MainActivity : BaseComposeActivity(), VariableDialog.Callback { ) } - entry( - metadata = NavDisplay.transitionSpec { - fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) - } + NavDisplay.popTransitionSpec { - fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) - } + NavDisplay.predictivePopTransitionSpec { _ -> - fadeIn(animationSpec = tween(300)) togetherWith - fadeOut(animationSpec = tween(300)) - } - ) { route -> + entry { route -> ExploreShowScreen( title = route.title ?: "探索", sourceUrl = route.sourceUrl,