From f3b48d96b3137883b968748551ddd38fbe37b903 Mon Sep 17 00:00:00 2001 From: Cuong-Tran Date: Fri, 15 Nov 2024 03:02:38 +0700 Subject: [PATCH] move `Suggestions` settings to same place --- .../screen/SettingsAppearanceScreen.kt | 25 ------------------- .../settings/screen/SettingsBrowseScreen.kt | 21 ++++++++++++++++ 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt index 5a9063862f..9ffd09a8fc 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt @@ -13,7 +13,6 @@ import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import com.materialkolor.PaletteStyle import eu.kanade.core.preference.asState -import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.ui.UiPreferences import eu.kanade.domain.ui.model.AppTheme import eu.kanade.domain.ui.model.TabletUiMode @@ -269,10 +268,6 @@ object SettingsAppearanceScreen : SearchableSettings { @Composable fun getForkGroup(uiPreferences: UiPreferences): Preference.PreferenceGroup { val previewsRowCount by uiPreferences.previewsRowCount().collectAsState() - // KMK --> - val sourcePreferences = remember { Injekt.get() } - val relatedMangasInOverflow by uiPreferences.expandRelatedMangas().collectAsState() - // KMK <-- return Preference.PreferenceGroup( stringResource(SYMR.strings.pref_category_fork), @@ -288,26 +283,6 @@ object SettingsAppearanceScreen : SearchableSettings { pref = uiPreferences.expandFilters(), title = stringResource(SYMR.strings.toggle_expand_search_filters), ), - // KMK --> - Preference.PreferenceItem.SwitchPreference( - pref = uiPreferences.expandRelatedMangas(), - title = stringResource(KMR.strings.pref_expand_related_mangas), - subtitle = stringResource(KMR.strings.pref_expand_related_mangas_summary), - enabled = sourcePreferences.relatedMangas().get(), - ), - Preference.PreferenceItem.SwitchPreference( - pref = uiPreferences.relatedMangasInOverflow(), - enabled = !relatedMangasInOverflow, - title = stringResource(KMR.strings.put_related_mangas_in_overflow), - subtitle = stringResource(KMR.strings.put_related_mangas_in_overflow_summary), - ), - Preference.PreferenceItem.SwitchPreference( - pref = uiPreferences.showHomeOnRelatedMangas(), - title = stringResource(KMR.strings.pref_show_home_on_related_mangas), - subtitle = stringResource(KMR.strings.pref_show_home_on_related_mangas_summary), - enabled = sourcePreferences.relatedMangas().get(), - ), - // KMK <-- Preference.PreferenceItem.SwitchPreference( pref = uiPreferences.recommendsInOverflow(), title = stringResource(SYMR.strings.put_recommends_in_overflow), diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt index a071a24441..a0239a5c19 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsBrowseScreen.kt @@ -53,6 +53,9 @@ object SettingsBrowseScreen : SearchableSettings { val uiPreferences = remember { Injekt.get() } val unsortedPreferences = remember { Injekt.get() } // SY <-- + // KMK --> + val relatedMangasInOverflow by uiPreferences.expandRelatedMangas().collectAsState() + // KMK <-- return listOf( // SY --> Preference.PreferenceGroup( @@ -64,6 +67,24 @@ object SettingsBrowseScreen : SearchableSettings { title = stringResource(KMR.strings.pref_source_related_mangas), subtitle = stringResource(KMR.strings.pref_source_related_mangas_summary), ), + Preference.PreferenceItem.SwitchPreference( + pref = uiPreferences.expandRelatedMangas(), + title = stringResource(KMR.strings.pref_expand_related_mangas), + subtitle = stringResource(KMR.strings.pref_expand_related_mangas_summary), + enabled = sourcePreferences.relatedMangas().get(), + ), + Preference.PreferenceItem.SwitchPreference( + pref = uiPreferences.relatedMangasInOverflow(), + enabled = !relatedMangasInOverflow, + title = stringResource(KMR.strings.put_related_mangas_in_overflow), + subtitle = stringResource(KMR.strings.put_related_mangas_in_overflow_summary), + ), + Preference.PreferenceItem.SwitchPreference( + pref = uiPreferences.showHomeOnRelatedMangas(), + title = stringResource(KMR.strings.pref_show_home_on_related_mangas), + subtitle = stringResource(KMR.strings.pref_show_home_on_related_mangas_summary), + enabled = sourcePreferences.relatedMangas().get(), + ), // KMK <-- kotlin.run { val count by sourcePreferences.sourcesTabCategories().collectAsState()