Settings refactor (#1615)
* Refactor main preferences to use DSL * Refactor account preferences to use DSL * Use DSL in rest of the preference screens * Preferences cleanup * Fix preference dependencies
This commit is contained in:
parent
4188b6ea09
commit
c64df0fd1d
14 changed files with 686 additions and 637 deletions
|
|
@ -1,81 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:key="@string/preferences_file_key">
|
||||
|
||||
<Preference
|
||||
android:key="notificationPreference"
|
||||
android:title="@string/pref_title_edit_notification_settings" />
|
||||
|
||||
<Preference
|
||||
android:key="tabPreference"
|
||||
android:title="@string/title_tab_preferences" />
|
||||
|
||||
<Preference
|
||||
android:key="mutedUsersPreference"
|
||||
android:title="@string/action_view_mutes" />
|
||||
|
||||
<Preference
|
||||
android:key="blockedUsersPreference"
|
||||
android:title="@string/action_view_blocks" />
|
||||
|
||||
<Preference
|
||||
android:key="mutedDomainsPreference"
|
||||
android:title="@string/action_view_domain_mutes" />
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_publishing">
|
||||
<ListPreference
|
||||
android:defaultValue="public"
|
||||
android:entries="@array/post_privacy_names"
|
||||
android:entryValues="@array/post_privacy_values"
|
||||
android:key="defaultPostPrivacy"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_default_post_privacy" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:icon="@drawable/ic_eye_24dp"
|
||||
android:key="defaultMediaSensitivity"
|
||||
android:title="@string/pref_default_media_sensitivity"
|
||||
app:singleLineTitle="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_title_timelines">
|
||||
<SwitchPreferenceCompat
|
||||
android:key="mediaPreviewEnabled"
|
||||
android:title="@string/pref_title_show_media_preview"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="alwaysShowSensitiveMedia"
|
||||
android:title="@string/pref_title_alway_show_sensitive_media"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="alwaysOpenSpoiler"
|
||||
android:title="@string/pref_title_alway_open_spoiler"
|
||||
app:singleLineTitle="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_title_timeline_filters">
|
||||
<Preference
|
||||
android:key="publicFilters"
|
||||
android:title="@string/pref_title_public_filter_keywords" />
|
||||
|
||||
<Preference
|
||||
android:key="notificationFilters"
|
||||
android:title="@string/title_notifications" />
|
||||
|
||||
<Preference
|
||||
android:key="homeFilters"
|
||||
android:title="@string/title_home" />
|
||||
|
||||
<Preference
|
||||
android:key="threadFilters"
|
||||
android:title="@string/pref_title_thread_filter_keywords" />
|
||||
|
||||
<Preference
|
||||
android:key="accountFilters"
|
||||
android:title="@string/title_accounts" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/pref_title_http_proxy_settings">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="httpProxyEnabled"
|
||||
android:title="@string/pref_title_http_proxy_enable"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="httpProxyServer"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_http_proxy_server"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<EditTextPreference
|
||||
android:key="httpProxyPort"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_http_proxy_port"
|
||||
app:iconSpaceReserved="false" />
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:key="notificationSettings"
|
||||
android:title="@string/pref_title_edit_notification_settings">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationsEnabled"
|
||||
android:title="@string/pref_title_notifications_enabled"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<PreferenceCategory
|
||||
android:dependency="notificationsEnabled"
|
||||
android:title="@string/pref_title_notification_filters"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationFilterMentions"
|
||||
android:title="@string/pref_title_notification_filter_mentions"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationFilterFollows"
|
||||
android:title="@string/pref_title_notification_filter_follows"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="notificationFilterFollowRequests"
|
||||
android:title="@string/pref_title_notification_filter_follow_requests"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationFilterReblogs"
|
||||
android:title="@string/pref_title_notification_filter_reblogs"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationFilterFavourites"
|
||||
android:title="@string/pref_title_notification_filter_favourites"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationFilterPolls"
|
||||
android:title="@string/pref_title_notification_filter_poll"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory
|
||||
android:dependency="notificationsEnabled"
|
||||
android:title="@string/pref_title_notification_alerts"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationAlertSound"
|
||||
android:title="@string/pref_title_notification_alert_sound"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationAlertVibrate"
|
||||
android:title="@string/pref_title_notification_alert_vibrate"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="notificationAlertLight"
|
||||
android:title="@string/pref_title_notification_alert_light"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:key="@string/preferences_file_key">
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_title_appearance_settings">
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="night"
|
||||
android:entries="@array/app_theme_names"
|
||||
android:entryValues="@array/app_theme_values"
|
||||
android:key="appTheme"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_app_theme" />
|
||||
|
||||
<com.keylesspalace.tusky.EmojiPreference
|
||||
android:defaultValue="@string/system_default"
|
||||
android:icon="@drawable/ic_emoji_24dp"
|
||||
android:key="emojiCompat"
|
||||
android:summary="@string/system_default"
|
||||
android:title="@string/emoji_style" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="default"
|
||||
android:entries="@array/language_entries"
|
||||
android:entryValues="@array/language_values"
|
||||
android:key="language"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_language" />
|
||||
|
||||
<ListPreference
|
||||
android:defaultValue="medium"
|
||||
android:entries="@array/status_text_size_names"
|
||||
android:entryValues="@array/status_text_size_values"
|
||||
android:key="statusTextSize"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_status_text_size" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="fabHide"
|
||||
android:title="@string/pref_title_hide_follow_button"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="absoluteTimeView"
|
||||
android:title="@string/pref_title_absolute_time"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="showBotOverlay"
|
||||
android:title="@string/pref_title_bot_overlay"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="animateGifAvatars"
|
||||
android:title="@string/pref_title_animate_gif_avatars"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="useBlurhash"
|
||||
android:title="@string/gradient_for_media"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="showNotificationsFilter"
|
||||
android:title="@string/pref_title_show_notifications_filter"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="showCardsInTimelines"
|
||||
android:title="@string/pref_title_show_cards_in_timelines"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="confirmReblogs"
|
||||
android:title="@string/pref_title_confirm_reblogs"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="enableSwipeForTabs"
|
||||
android:title="@string/pref_title_enable_swipe_for_tabs"
|
||||
app:singleLineTitle="false" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_title_browser_settings">
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="false"
|
||||
android:key="customTabs"
|
||||
android:title="@string/pref_title_custom_tabs"
|
||||
app:singleLineTitle="false" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_title_status_filter">
|
||||
|
||||
<Preference
|
||||
android:key="timelineFilterPreferences"
|
||||
android:title="@string/pref_title_status_tabs" />
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory android:title="@string/pref_title_proxy_settings">
|
||||
|
||||
<Preference
|
||||
android:key="httpProxyPreferences"
|
||||
android:summary="%s"
|
||||
android:title="@string/pref_title_http_proxy_settings" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:title="@string/pref_title_status_tabs">
|
||||
|
||||
<PreferenceCategory
|
||||
android:title="@string/title_home"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="tabFilterHomeBoosts"
|
||||
android:title="@string/pref_title_show_boosts"
|
||||
app:iconSpaceReserved="false" />
|
||||
|
||||
<CheckBoxPreference
|
||||
android:defaultValue="true"
|
||||
android:key="tabFilterHomeReplies"
|
||||
android:title="@string/pref_title_show_replies"
|
||||
app:iconSpaceReserved="false" />
|
||||
</PreferenceCategory>
|
||||
</androidx.preference.PreferenceScreen>
|
||||
Loading…
Add table
Add a link
Reference in a new issue