From b3ee5100503017747b1165c6be65262356e99e9c Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Mon, 20 Nov 2023 18:08:13 +1100 Subject: [PATCH] refactor: add group category for sync. Adding group gives more clarity. Signed-off-by: KaiserBh --- .../settings/screen/SettingsDataScreen.kt | 23 +++++++++++-------- .../commonMain/resources/MR/base/strings.xml | 3 ++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt index a1b55ab74..631a68949 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsDataScreen.kt @@ -367,15 +367,20 @@ object SettingsDataScreen : SearchableSettings { @Composable private fun getSyncPreferences(syncPreferences: SyncPreferences, syncService: Int): List { return listOf( - Preference.PreferenceItem.ListPreference( - pref = syncPreferences.syncService(), - title = stringResource(MR.strings.pref_sync_service), - entries = mapOf( - SyncManager.SyncService.NONE.value to stringResource(MR.strings.off), - SyncManager.SyncService.SYNCYOMI.value to stringResource(MR.strings.syncyomi), - SyncManager.SyncService.GOOGLE_DRIVE.value to stringResource(MR.strings.google_drive), + Preference.PreferenceGroup( + title = stringResource(MR.strings.pref_sync_service_category), + preferenceItems = listOf( + Preference.PreferenceItem.ListPreference( + pref = syncPreferences.syncService(), + title = stringResource(MR.strings.pref_sync_service), + entries = mapOf( + SyncManager.SyncService.NONE.value to stringResource(MR.strings.off), + SyncManager.SyncService.SYNCYOMI.value to stringResource(MR.strings.syncyomi), + SyncManager.SyncService.GOOGLE_DRIVE.value to stringResource(MR.strings.google_drive), + ), + onValueChanged = { true }, + ), ), - onValueChanged = { true }, ), ) + getSyncServicePreferences(syncPreferences, syncService) } @@ -552,7 +557,7 @@ private fun getAutomaticSyncGroup(syncPreferences: SyncPreferences): Preference. val lastSync by syncPreferences.lastSyncTimestamp().collectAsState() return Preference.PreferenceGroup( - title = stringResource(MR.strings.pref_sync_service_category), + title = stringResource(MR.strings.pref_sync_automatic_category), preferenceItems = listOf( Preference.PreferenceItem.ListPreference( pref = syncIntervalPref, diff --git a/i18n/src/commonMain/resources/MR/base/strings.xml b/i18n/src/commonMain/resources/MR/base/strings.xml index a2757f5f9..079136828 100644 --- a/i18n/src/commonMain/resources/MR/base/strings.xml +++ b/i18n/src/commonMain/resources/MR/base/strings.xml @@ -525,7 +525,8 @@ Syncing will overwrite your local library with the remote library. Are you sure you want to continue? Service Select the service to sync your library with - Automatic Synchronization + Sync + Automatic Synchronization Synchronization frequency SyncYomi Done in %1$s