refactor: add group category for sync.

Adding group gives more clarity.

Signed-off-by: KaiserBh <kaiserbh@proton.me>
This commit is contained in:
KaiserBh 2023-11-20 18:08:13 +11:00
parent d180d1de45
commit b3ee510050
No known key found for this signature in database
GPG Key ID: 14D73B142042BBA9
2 changed files with 16 additions and 10 deletions

View File

@ -367,15 +367,20 @@ object SettingsDataScreen : SearchableSettings {
@Composable
private fun getSyncPreferences(syncPreferences: SyncPreferences, syncService: Int): List<Preference> {
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,

View File

@ -525,7 +525,8 @@
<string name="pref_sync_confirmation_message">Syncing will overwrite your local library with the remote library. Are you sure you want to continue?</string>
<string name="pref_sync_service">Service</string>
<string name="pref_sync_service_summ">Select the service to sync your library with</string>
<string name="pref_sync_service_category">Automatic Synchronization</string>
<string name="pref_sync_service_category">Sync</string>
<string name="pref_sync_automatic_category">Automatic Synchronization</string>
<string name="pref_sync_interval">Synchronization frequency</string>
<string name="syncyomi">SyncYomi</string>
<string name="sync_completed_message">Done in %1$s</string>