mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 07:11:49 +01:00
Highlight restore backup setting when navigating from onboarding step
This commit is contained in:
parent
19f0175a56
commit
93cbeca5c0
@ -54,6 +54,8 @@ import uy.kohesive.injekt.api.get
|
|||||||
|
|
||||||
object SettingsDataScreen : SearchableSettings {
|
object SettingsDataScreen : SearchableSettings {
|
||||||
|
|
||||||
|
val restorePreferenceKeyString = MR.strings.label_backup
|
||||||
|
|
||||||
@ReadOnlyComposable
|
@ReadOnlyComposable
|
||||||
@Composable
|
@Composable
|
||||||
override fun getTitleRes() = MR.strings.label_data_storage
|
override fun getTitleRes() = MR.strings.label_data_storage
|
||||||
@ -143,7 +145,7 @@ object SettingsDataScreen : SearchableSettings {
|
|||||||
preferenceItems = listOf(
|
preferenceItems = listOf(
|
||||||
// Manual actions
|
// Manual actions
|
||||||
Preference.PreferenceItem.CustomPreference(
|
Preference.PreferenceItem.CustomPreference(
|
||||||
title = stringResource(MR.strings.label_backup),
|
title = stringResource(restorePreferenceKeyString),
|
||||||
) {
|
) {
|
||||||
BasePreferenceWidget(
|
BasePreferenceWidget(
|
||||||
subcomponent = {
|
subcomponent = {
|
||||||
|
@ -8,8 +8,11 @@ import cafe.adriel.voyager.navigator.LocalNavigator
|
|||||||
import cafe.adriel.voyager.navigator.currentOrThrow
|
import cafe.adriel.voyager.navigator.currentOrThrow
|
||||||
import eu.kanade.domain.base.BasePreferences
|
import eu.kanade.domain.base.BasePreferences
|
||||||
import eu.kanade.presentation.more.onboarding.OnboardingScreen
|
import eu.kanade.presentation.more.onboarding.OnboardingScreen
|
||||||
|
import eu.kanade.presentation.more.settings.screen.SearchableSettings
|
||||||
|
import eu.kanade.presentation.more.settings.screen.SettingsDataScreen
|
||||||
import eu.kanade.presentation.util.Screen
|
import eu.kanade.presentation.util.Screen
|
||||||
import eu.kanade.tachiyomi.ui.setting.SettingsScreen
|
import eu.kanade.tachiyomi.ui.setting.SettingsScreen
|
||||||
|
import tachiyomi.presentation.core.i18n.stringResource
|
||||||
import tachiyomi.presentation.core.util.collectAsState
|
import tachiyomi.presentation.core.util.collectAsState
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
@ -28,6 +31,8 @@ class OnboardingScreen : Screen() {
|
|||||||
navigator.pop()
|
navigator.pop()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val restoreSettingKey = stringResource(SettingsDataScreen.restorePreferenceKeyString)
|
||||||
|
|
||||||
BackHandler(
|
BackHandler(
|
||||||
enabled = !shownOnboardingFlow,
|
enabled = !shownOnboardingFlow,
|
||||||
onBack = {
|
onBack = {
|
||||||
@ -39,6 +44,7 @@ class OnboardingScreen : Screen() {
|
|||||||
onComplete = finishOnboarding,
|
onComplete = finishOnboarding,
|
||||||
onRestoreBackup = {
|
onRestoreBackup = {
|
||||||
finishOnboarding()
|
finishOnboarding()
|
||||||
|
SearchableSettings.highlightKey = restoreSettingKey
|
||||||
navigator.push(SettingsScreen(SettingsScreen.Destination.DataAndStorage))
|
navigator.push(SettingsScreen(SettingsScreen.Destination.DataAndStorage))
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user