Standardize settings entirely
Update the structure of the settings system to do several things: - Finally use int preferences everywhere instead of the mix of strings & ints from before - Create a new preference named `IntListPreference` that enables the use of integers in list preferences - Actually centralize array values and default values into a single integers xml - Isolate all the new migration code into a single file - Refreshed the int tables used by data objects [DB version has been updated, will not update when other changes] The only preference not migrated is doAtEnd since that is being planned to be retired in a future LoopMode update.
This commit is contained in:
@@ -1,148 +1,150 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/item_header"
|
||||
android:title="@string/setting_ui">
|
||||
<ListPreference
|
||||
android:entries="@array/entires_theme"
|
||||
android:entryValues="@array/values_theme"
|
||||
android:icon="@drawable/ic_day"
|
||||
android:title="@string/setting_theme"
|
||||
app:defaultValue="AUTO"
|
||||
app:key="KEY_THEME"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
app:layout="@layout/item_header"
|
||||
app:title="@string/setting_ui">
|
||||
|
||||
<org.oxycblt.auxio.settings.ui.IntListPreference
|
||||
app:defaultValue="@integer/theme_auto"
|
||||
app:entries="@array/entires_theme"
|
||||
app:entryValues="@array/values_theme"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_THEME2"
|
||||
app:icon="@drawable/ic_day"
|
||||
app:title="@string/setting_theme" />
|
||||
|
||||
<Preference
|
||||
android:icon="@drawable/ic_accent"
|
||||
android:title="@string/setting_accent"
|
||||
app:allowDividerBelow="false"
|
||||
app:icon="@drawable/ic_accent"
|
||||
app:key="KEY_ACCENT2"
|
||||
app:summary="@string/setting_accent_unknown" />
|
||||
app:summary="@string/color_label_blue"
|
||||
app:title="@string/setting_accent" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/item_header"
|
||||
android:title="@string/setting_display">
|
||||
app:layout="@layout/item_header"
|
||||
app:title="@string/setting_display">
|
||||
|
||||
<ListPreference
|
||||
android:icon="@drawable/ic_artist"
|
||||
android:title="@string/setting_lib_display"
|
||||
app:defaultValue="SHOW_ARTISTS"
|
||||
<org.oxycblt.auxio.settings.ui.IntListPreference
|
||||
app:defaultValue="@integer/display_artist"
|
||||
app:entries="@array/entries_lib_display"
|
||||
app:entryValues="@array/values_lib_display"
|
||||
app:key="KEY_LIBRARY_DISPLAY_MODE"
|
||||
app:icon="@drawable/ic_artist"
|
||||
app:key="KEY_LIB_MODE"
|
||||
app:title="@string/setting_lib_display"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_show_covers"
|
||||
app:defaultValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_SHOW_COVERS"
|
||||
app:summary="@string/setting_show_covers_desc" />
|
||||
app:summary="@string/setting_show_covers_desc"
|
||||
app:title="@string/setting_show_covers" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_quality_covers"
|
||||
app:defaultValue="false"
|
||||
app:dependency="KEY_SHOW_COVERS"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_QUALITY_COVERS"
|
||||
app:summary="@string/setting_quality_covers_desc" />
|
||||
app:summary="@string/setting_quality_covers_desc"
|
||||
app:title="@string/setting_quality_covers" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_color_notif"
|
||||
app:defaultValue="true"
|
||||
app:dependency="KEY_SHOW_COVERS"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_COLOR_NOTIF"
|
||||
app:summary="@string/setting_color_desc" />
|
||||
app:summary="@string/setting_color_desc"
|
||||
app:title="@string/setting_color_notif" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_use_alt_action"
|
||||
app:allowDividerBelow="false"
|
||||
app:defaultValue="false"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_ALT_NOTIF_ACTION"
|
||||
app:summaryOff="@string/setting_use_alt_loop"
|
||||
app:summaryOn="@string/setting_use_alt_shuffle" />
|
||||
app:summaryOn="@string/setting_use_alt_shuffle"
|
||||
app:title="@string/setting_use_alt_action" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/item_header"
|
||||
android:title="@string/setting_audio">
|
||||
app:layout="@layout/item_header"
|
||||
app:title="@string/setting_audio">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_audio_focus"
|
||||
app:defaultValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_AUDIO_FOCUS"
|
||||
app:summary="@string/setting_audio_focus_desc" />
|
||||
app:summary="@string/setting_audio_focus_desc"
|
||||
app:title="@string/setting_audio_focus" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_audio_plug_mgt"
|
||||
app:allowDividerBelow="false"
|
||||
app:defaultValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_PLUG_MGT"
|
||||
app:summary="@string/setting_audio_plug_mgt_desc" />
|
||||
app:summary="@string/setting_audio_plug_mgt_desc"
|
||||
app:title="@string/setting_audio_plug_mgt" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/item_header"
|
||||
android:title="@string/setting_behavior">
|
||||
app:layout="@layout/item_header"
|
||||
app:title="@string/setting_behavior">
|
||||
|
||||
<ListPreference
|
||||
android:title="@string/setting_behavior_song_playback_mode"
|
||||
app:defaultValue="ALL_SONGS"
|
||||
<org.oxycblt.auxio.settings.ui.IntListPreference
|
||||
app:defaultValue="@integer/play_mode_songs"
|
||||
app:entries="@array/entries_song_playback_mode"
|
||||
app:entryValues="@array/values_song_playback_mode"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_SONG_PLAY_MODE"
|
||||
app:key="KEY_SONG_PLAY_MODE2"
|
||||
app:title="@string/setting_behavior_song_playback_mode"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<ListPreference
|
||||
android:title="@string/setting_behavior_at_end"
|
||||
app:defaultValue="LOOP_PAUSE"
|
||||
app:entries="@array/entries_at_end"
|
||||
app:entryValues="@array/values_at_end"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_AT_END"
|
||||
app:title="@string/setting_behavior_at_end"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:title="@string/setting_behavior_keep_shuffle"
|
||||
app:defaultValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_KEEP_SHUFFLE"
|
||||
app:summary="@string/setting_behavior_keep_shuffle_desc" />
|
||||
app:summary="@string/setting_behavior_keep_shuffle_desc"
|
||||
app:title="@string/setting_behavior_keep_shuffle" />
|
||||
|
||||
<SwitchPreference
|
||||
android:title="@string/setting_behavior_rewind_prev"
|
||||
app:allowDividerBelow="false"
|
||||
app:defaultValue="true"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_PREV_REWIND"
|
||||
app:summary="@string/setting_behavior_rewind_prev_desc" />
|
||||
app:summary="@string/setting_behavior_rewind_prev_desc"
|
||||
app:title="@string/setting_behavior_rewind_prev" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:layout="@layout/item_header"
|
||||
android:title="@string/setting_content">
|
||||
app:layout="@layout/item_header"
|
||||
app:title="@string/setting_content">
|
||||
|
||||
<Preference
|
||||
android:title="@string/setting_content_save"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_SAVE_STATE"
|
||||
app:summary="@string/setting_content_save_desc" />
|
||||
app:summary="@string/setting_content_save_desc"
|
||||
app:title="@string/setting_content_save" />
|
||||
|
||||
<Preference
|
||||
android:title="@string/setting_content_blacklist"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="KEY_BLACKLIST"
|
||||
app:summary="@string/setting_content_blacklist_desc" />
|
||||
app:summary="@string/setting_content_blacklist_desc"
|
||||
app:title="@string/setting_content_blacklist" />
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
Reference in New Issue
Block a user