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,6 +367,9 @@ object SettingsDataScreen : SearchableSettings {
@Composable @Composable
private fun getSyncPreferences(syncPreferences: SyncPreferences, syncService: Int): List<Preference> { private fun getSyncPreferences(syncPreferences: SyncPreferences, syncService: Int): List<Preference> {
return listOf( return listOf(
Preference.PreferenceGroup(
title = stringResource(MR.strings.pref_sync_service_category),
preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = syncPreferences.syncService(), pref = syncPreferences.syncService(),
title = stringResource(MR.strings.pref_sync_service), title = stringResource(MR.strings.pref_sync_service),
@ -377,6 +380,8 @@ object SettingsDataScreen : SearchableSettings {
), ),
onValueChanged = { true }, onValueChanged = { true },
), ),
),
),
) + getSyncServicePreferences(syncPreferences, syncService) ) + getSyncServicePreferences(syncPreferences, syncService)
} }
} }
@ -552,7 +557,7 @@ private fun getAutomaticSyncGroup(syncPreferences: SyncPreferences): Preference.
val lastSync by syncPreferences.lastSyncTimestamp().collectAsState() val lastSync by syncPreferences.lastSyncTimestamp().collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(MR.strings.pref_sync_service_category), title = stringResource(MR.strings.pref_sync_automatic_category),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = syncIntervalPref, 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_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">Service</string>
<string name="pref_sync_service_summ">Select the service to sync your library with</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="pref_sync_interval">Synchronization frequency</string>
<string name="syncyomi">SyncYomi</string> <string name="syncyomi">SyncYomi</string>
<string name="sync_completed_message">Done in %1$s</string> <string name="sync_completed_message">Done in %1$s</string>