diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-03-15 13:02:23 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-03-15 13:02:23 +0000 |
commit | 12036d05e27a2b9af25dc1de1a0a06bc3123a0a5 (patch) | |
tree | b9f7b2d7450fa0918f963f1e53d1b91e92817064 | |
parent | cf370d215c14a6a96edd2cacf7264d07729034d3 (diff) | |
download | infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.tar infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.tar.gz infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.tar.bz2 infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.tar.lz infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.tar.xz infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.tar.zst infinity-for-reddit-12036d05e27a2b9af25dc1de1a0a06bc3123a0a5.zip |
Use string resource in array resource. Rearrange settings.
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java | 3 | ||||
-rw-r--r-- | app/src/main/res/values/arrays.xml | 164 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 14 | ||||
-rw-r--r-- | app/src/main/res/xml/interface_preferences.xml | 14 |
4 files changed, 106 insertions, 89 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java index c1183636..20e215e7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SettingsActivity.java @@ -35,6 +35,7 @@ import ml.docilealligator.infinityforreddit.settings.InterfacePreferenceFragment import ml.docilealligator.infinityforreddit.settings.MainPreferenceFragment; import ml.docilealligator.infinityforreddit.settings.NsfwAndSpoilerFragment; import ml.docilealligator.infinityforreddit.settings.PostHistoryFragment; +import ml.docilealligator.infinityforreddit.settings.PostPreferenceFragment; import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; public class SettingsActivity extends BaseActivity implements @@ -104,6 +105,8 @@ public class SettingsActivity extends BaseActivity implements setTitle(R.string.settings_font_title); } else if (fragment instanceof GesturesAndButtonsPreferenceFragment) { setTitle(R.string.settings_gestures_and_buttons_title); + } else if (fragment instanceof PostPreferenceFragment) { + setTitle(R.string.settings_category_post_title); } }); } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 2c65f6e0..764afcf1 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -24,15 +24,15 @@ </string-array> <string-array name="settings_theme_q"> - <item>Light Theme</item> - <item>Dark Theme</item> - <item>Device Default</item> + <item>@string/light_theme</item> + <item>@string/dark_theme</item> + <item>@string/device_default</item> </string-array> <string-array name="settings_theme"> - <item>Light Theme</item> - <item>Dark Theme</item> - <item>Set by Battery Saver</item> + <item>@string/light_theme</item> + <item>@string/dark_theme</item> + <item>@string/set_by_battery_saver</item> </string-array> <string-array name="settings_theme_values"> @@ -42,10 +42,10 @@ </string-array> <string-array name="settings_default_post_layout"> - <item>Card Layout</item> - <item>Card Layout 2</item> - <item>Compact Layout</item> - <item>Gallery Layout</item> + <item>@string/post_layout_card</item> + <item>@string/post_layout_card_2</item> + <item>@string/post_layout_compact</item> + <item>@string/post_layout_gallery</item> </string-array> <string-array name="settings_default_post_layout_values"> @@ -56,9 +56,9 @@ </string-array> <string-array name="settings_video_autoplay"> - <item>Always On</item> - <item>Only on Wifi</item> - <item>Never</item> + <item>@string/always_on</item> + <item>@string/only_on_wifi</item> + <item>@string/never</item> </string-array> <string-array name="settings_video_autoplay_values"> @@ -88,10 +88,10 @@ </string-array> <string-array name="settings_font_size"> - <item>Small</item> - <item>Normal</item> - <item>Large</item> - <item>Extra Large</item> + <item>@string/small</item> + <item>@string/normal</item> + <item>@string/large</item> + <item>@string/extra_large</item> </string-array> <string-array name="settings_font_size_values"> @@ -102,10 +102,10 @@ </string-array> <string-array name="settings_title_font_size"> - <item>Small</item> - <item>Normal</item> - <item>Large</item> - <item>Extra Large</item> + <item>@string/small</item> + <item>@string/normal</item> + <item>@string/large</item> + <item>@string/extra_large</item> </string-array> <string-array name="settings_title_font_size_values"> @@ -116,11 +116,11 @@ </string-array> <string-array name="settings_content_font_size"> - <item>Small</item> - <item>Normal</item> - <item>Large</item> - <item>Extra Large</item> - <item>Enormously Large</item> + <item>@string/small</item> + <item>@string/normal</item> + <item>@string/large</item> + <item>@string/extra_large</item> + <item>@string/enormously_large</item> </string-array> <string-array name="settings_content_font_size_values"> @@ -132,7 +132,7 @@ </string-array> <string-array name="settings_font_family"> - <item>Default</item> + <item>@string/default_in_array</item> <item>Balsamiq Sans</item> <item>Balsamiq Sans Bold</item> <item>Noto Sans</item> @@ -166,17 +166,17 @@ </string-array> <string-array name="settings_tab_post_type"> - <item>Home</item> - <item>Popular</item> - <item>All</item> - <item>Subreddit</item> - <item>MultiReddit</item> - <item>User</item> - <item>Upvoted</item> - <item>Downvoted</item> - <item>Hidden</item> - <item>Saved</item> - <item>Gilded</item> + <item>@string/home</item> + <item>@string/popular</item> + <item>@string/all</item> + <item>@string/subreddit</item> + <item>@string/multi_reddit</item> + <item>@string/user</item> + <item>@string/upvoted</item> + <item>@string/downvoted</item> + <item>@string/hidden</item> + <item>@string/saved</item> + <item>@string/gilded</item> </string-array> <string-array name="settings_time_format"> @@ -247,51 +247,51 @@ </string-array> <string-array name="settings_main_activity_bottom_app_bar_options"> - <item>Subscriptions</item> - <item>Multireddits</item> - <item>Inbox</item> - <item>Profile</item> - <item>Submit posts</item> - <item>Refresh</item> - <item>Change sort type</item> - <item>Change post layout</item> - <item>Search</item> - <item>Go to Subreddit</item> - <item>Go to User</item> - <item>Random</item> - <item>Hide Read Posts</item> - <item>Filter Posts</item> + <item>@string/subscriptions</item> + <item>@string/multi_reddits</item> + <item>@string/inbox</item> + <item>@string/profile</item> + <item>@string/submit_post</item> + <item>@string/refresh</item> + <item>@string/change_sort_type</item> + <item>@string/change_post_layout</item> + <item>@string/search</item> + <item>@string/go_to_subreddit</item> + <item>@string/go_to_user</item> + <item>@string/random</item> + <item>@string/hide_read_posts</item> + <item>@string/filter_posts</item> </string-array> <string-array name="settings_other_activities_bottom_app_bar_options"> - <item>Home</item> - <item>Subscriptions</item> - <item>Inbox</item> - <item>Profile</item> - <item>Multireddits</item> - <item>Submit posts</item> - <item>Refresh</item> - <item>Change sort type</item> - <item>Change post layout</item> - <item>Search</item> - <item>Go to Subreddit</item> - <item>Go to User</item> - <item>Random</item> - <item>Hide Read Posts</item> - <item>Filter Posts</item> + <item>@string/home</item> + <item>@string/subscriptions</item> + <item>@string/inbox</item> + <item>@string/profile</item> + <item>@string/multi_reddits</item> + <item>@string/submit_post</item> + <item>@string/refresh</item> + <item>@string/change_sort_type</item> + <item>@string/change_post_layout</item> + <item>@string/search</item> + <item>@string/go_to_subreddit</item> + <item>@string/go_to_user</item> + <item>@string/random</item> + <item>@string/hide_read_posts</item> + <item>@string/filter_posts</item> </string-array> <string-array name="settings_bottom_app_bar_fab_options"> - <item>Submit posts</item> - <item>Refresh</item> - <item>Change sort type</item> - <item>Change post layout</item> - <item>Search</item> - <item>Go to Subreddit</item> - <item>Go to User</item> - <item>Random</item> - <item>Hide Read Posts</item> - <item>Filter Posts</item> + <item>@string/submit_post</item> + <item>@string/refresh</item> + <item>@string/change_sort_type</item> + <item>@string/change_post_layout</item> + <item>@string/search</item> + <item>@string/go_to_subreddit</item> + <item>@string/go_to_user</item> + <item>@string/random</item> + <item>@string/hide_read_posts</item> + <item>@string/filter_posts</item> </string-array> <string-array name="settings_swipe_action_threshold"> @@ -306,9 +306,9 @@ </string-array> <string-array name="settings_data_saving_mode"> - <item>Off</item> - <item>Only on Cellular Data</item> - <item>Always on</item> + <item>@string/off</item> + <item>@string/only_on_cellular_data</item> + <item>@string/always_on</item> </string-array> <string-array name="settings_data_saving_mode_values"> @@ -318,8 +318,8 @@ </string-array> <string-array name="settings_swipe_actions"> - <item>Upvote</item> - <item>Downvote</item> + <item>@string/upvote</item> + <item>@string/downvote</item> </string-array> <string-array name="settings_swipe_actions_values"> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e6a546f7..254384a7 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -637,6 +637,8 @@ <string name="light_theme">Light Theme</string> <string name="dark_theme">Dark Theme</string> + <string name="device_default">Device Default</string> + <string name="set_by_battery_saver">Set by Battery Saver</string> <string name="multi_reddit_name_hint">Name (Max 50 Characters)</string> <string name="multi_reddit_description_hint">Description</string> @@ -1068,4 +1070,16 @@ <string name="error_fetching_v_redd_it_video_cannot_get_post">Error fetching v.redd.it video: Cannot get the post</string> <string name="error_fetching_v_redd_it_video_cannot_get_post_id">Error fetching v.redd.it video: Cannot get the post id</string> + <string name="always_on">Always On</string> + <string name="only_on_wifi">Only on Wifi</string> + <string name="never">Never</string> + <string name="normal">Normal</string> + <string name="extra_large">Extra Large</string> + <string name="enormously_large">Enormously Large</string> + <string name="default_in_array">Default</string> + <string name="off">Off</string> + <string name="only_on_cellular_data">Only on Cellular Data</string> + <string name="upvote">Upvote</string> + <string name="downvote">Downvote</string> + </resources> diff --git a/app/src/main/res/xml/interface_preferences.xml b/app/src/main/res/xml/interface_preferences.xml index 6387a850..a834ac10 100644 --- a/app/src/main/res/xml/interface_preferences.xml +++ b/app/src/main/res/xml/interface_preferences.xml @@ -33,9 +33,10 @@ app:title="@string/settings_enable_bottom_app_bar_title" app:summary="@string/settings_enable_bottom_app_bar_summary" /> - <Preference - app:title="@string/settings_time_format_title" - app:fragment="ml.docilealligator.infinityforreddit.settings.TimeFormatPreferenceFragment" /> + <SwitchPreference + app:defaultValue="false" + app:key="hide_subreddit_description" + app:title="@string/settings_hide_subreddit_description_title" /> <ListPreference app:defaultValue="0" @@ -45,10 +46,9 @@ app:title="@string/settings_default_search_result_tab" app:useSimpleSummaryProvider="true" /> - <SwitchPreference - app:defaultValue="false" - app:key="hide_subreddit_description" - app:title="@string/settings_hide_subreddit_description_title" /> + <Preference + app:title="@string/settings_time_format_title" + app:fragment="ml.docilealligator.infinityforreddit.settings.TimeFormatPreferenceFragment" /> <Preference app:title="@string/settings_category_post_title" |