Always enable predictive nav

This commit is contained in:
GG Bond authored and Vladimir Dostoyevskiy committed 2023-12-28 00:39:06 +08:00
1 parent e0bb09e902
commit 0333a8c679
3 files changed
+3 -16

No files matched your search

@@ -28,7 +28,6 @@ import androidx.compose.animation.core.ExperimentalTransitionApi
import androidx.compose.animation.core.SeekableTransitionState
import androidx.compose.animation.core.rememberTransition
import androidx.compose.animation.core.tween
import androidx.compose.animation.core.updateTransition
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
import androidx.compose.animation.togetherWith
@@ -55,8 +54,6 @@ import androidx.navigation.NavHostController
import androidx.navigation.Navigator
import androidx.navigation.createGraph
import androidx.navigation.get
import com.hippo.ehviewer.Settings
import com.hippo.ehviewer.collectAsState
import kotlinx.coroutines.CancellationException
/**
@@ -246,15 +243,10 @@ public fun NavHost(
val zIndices = remember { mutableMapOf<String, Float>() }
if (backStackEntry != null) {
val enablePredictiveBack by Settings.predictiveNavAnim.collectAsState()
val transitionState = remember { SeekableTransitionState(backStackEntry) }
val transition = if (enablePredictiveBack) {
LaunchedEffect(backStackEntry) {
transitionState.animateTo(backStackEntry)
}
rememberTransition(transitionState, label = "entry")
} else {
updateTransition(backStackEntry, label = "entry")
val transition = rememberTransition(transitionState, label = "entry")
LaunchedEffect(backStackEntry) {
transitionState.animateTo(backStackEntry)
}
var inPredictiveBack by remember { mutableStateOf(false) }
@@ -109,7 +109,6 @@ object Settings : DataStorePreferences(null) {
val listThumbSize = intPref("list_tile_size", 40)
val languageFilter = intPref("language_filter", -1)
val meteredNetworkWarning = boolPref("cellular_network_warning", false)
val predictiveNavAnim = boolPref("predictive_nav_anim", true)
val blackDarkTheme = boolPref("black_dark_theme", false)
var downloadScheme by stringOrNullPref("image_scheme", null)
@@ -188,10 +188,6 @@ fun AdvancedScreen(navigator: DestinationsNavigator) {
title = stringResource(id = R.string.preload_thumb_aggressively),
value = Settings::preloadThumbAggressively,
)
SwitchPreference(
title = stringResource(id = R.string.predictive_nav_anim),
value = Settings.predictiveNavAnim::value,
)
IntSliderPreference(
maxValue = 5,
minValue = 1,