aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-02-17 13:44:59 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-02-17 13:44:59 +0000
commit52d6691ae7ea7d9d5a19bede87b913f33e0645a3 (patch)
treeda85b2f9454e28a8629cafa9552cd6cb9f4334ee /app/src/main/res
parent9b9a1aa308659fc2f031f468002eeff15323b9d6 (diff)
downloadinfinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.tar
infinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.tar.gz
infinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.tar.bz2
infinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.tar.lz
infinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.tar.xz
infinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.tar.zst
infinity-for-reddit-52d6691ae7ea7d9d5a19bede87b913f33e0645a3.zip
Customize the number of columns in Post Feed for every post layout.
Diffstat (limited to '')
-rw-r--r--app/src/main/res/values/strings.xml2
-rw-r--r--app/src/main/res/xml/comment_preferences.xml30
-rw-r--r--app/src/main/res/xml/gestures_and_buttons_preferences.xml (renamed from app/src/main/res/xml/gestures_and_buttons_preference.xml)0
-rw-r--r--app/src/main/res/xml/interface_preference.xml117
-rw-r--r--app/src/main/res/xml/interface_preferences.xml62
-rw-r--r--app/src/main/res/xml/number_of_columns_in_post_feed_preferences.xml43
-rw-r--r--app/src/main/res/xml/post_preferences.xml37
7 files changed, 173 insertions, 118 deletions
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 0f073b9b..57b528e7 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -1020,5 +1020,7 @@
<string name="have_trouble_login_title">Having Trouble Login</string>
<string name="have_trouble_login_message">Do you want to try another way to login?</string>
+ <!-- TODO: Remove or change this placeholder text -->
+ <string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
diff --git a/app/src/main/res/xml/comment_preferences.xml b/app/src/main/res/xml/comment_preferences.xml
new file mode 100644
index 00000000..2248d7f3
--- /dev/null
+++ b/app/src/main/res/xml/comment_preferences.xml
@@ -0,0 +1,30 @@
+<?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">
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="show_top_level_comments_first"
+ app:title="@string/settings_show_top_level_comments_first_title" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="show_comment_divider"
+ app:title="@string/settings_show_comment_divider_title" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="comment_toolbar_hidden"
+ app:title="@string/settings_comment_toolbar_hidden" />
+
+ <SwitchPreference
+ app:defaultValue="true"
+ app:key="comment_toolbar_hide_on_click"
+ app:title="@string/settings_comment_toolbar_hide_on_click" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="fully_collapse_comment"
+ android:title="@string/settings_fully_collapse_comment_title" />
+
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/gestures_and_buttons_preference.xml b/app/src/main/res/xml/gestures_and_buttons_preferences.xml
index 02a37524..02a37524 100644
--- a/app/src/main/res/xml/gestures_and_buttons_preference.xml
+++ b/app/src/main/res/xml/gestures_and_buttons_preferences.xml
diff --git a/app/src/main/res/xml/interface_preference.xml b/app/src/main/res/xml/interface_preference.xml
deleted file mode 100644
index b55853c1..00000000
--- a/app/src/main/res/xml/interface_preference.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?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">
-
- <Preference
- app:title="@string/settings_font_title"
- app:icon="@drawable/ic_font_size_24dp"
- app:fragment="ml.docilealligator.infinityforreddit.settings.FontPreferenceFragment" />
-
- <Preference
- app:key="immersive_interface_entry"
- app:title="@string/settings_immersive_interface_title"
- app:fragment="ml.docilealligator.infinityforreddit.settings.ImmersiveInterfacePreferenceFragment"
- app:isPreferenceVisible="false" />
-
- <Preference
- app:title="@string/settings_customize_tabs_in_main_page_title"
- app:summary="@string/only_for_logged_in_user"
- app:fragment="ml.docilealligator.infinityforreddit.settings.CustomizeMainPageTabsFragment" />
-
- <Preference
- app:title="@string/settings_customize_bottom_app_bar_title"
- app:summary="@string/only_for_logged_in_user"
- app:fragment="ml.docilealligator.infinityforreddit.settings.CustomizeBottomAppBarFragment" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="bottom_app_bar"
- 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" />
-
- <PreferenceCategory
- app:title="@string/settings_category_post_and_comment_title" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="vote_buttons_on_the_right"
- app:title="@string/settings_vote_buttons_on_the_right_title" />
-
- <SwitchPreference
- app:defaultValue="true"
- app:key="show_absolute_number_of_votes"
- app:title="@string/settings_show_absolute_number_of_votes_title" />
-
- <PreferenceCategory
- app:title="@string/settings_category_post_title" />
-
- <ListPreference
- app:defaultValue="0"
- android:entries="@array/settings_default_post_layout"
- app:entryValues="@array/settings_default_post_layout_values"
- app:key="default_post_layout"
- app:title="@string/settings_default_post_layout"
- app:useSimpleSummaryProvider="true" />
-
- <SwitchPreference
- app:defaultValue="true"
- app:key="show_divider_in_compact_layout"
- app:title="@string/settings_show_divider_in_compact_layout" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="show_thumbnail_on_the_left_in_compact_layout"
- app:title="@string/settings_show_thumbnail_on_the_left_in_compact_layout" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="long_press_to_hide_toolbar_in_compact_layout"
- app:title="@string/settings_long_press_to_hide_toolbar_in_compact_layout_title" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="post_compact_layout_toolbar_hidden_by_default"
- app:title="@string/settings_post_compact_layout_toolbar_hidden_by_default_title" />
-
- <Preference
- app:title="@string/settings_number_of_columns_in_post_feed_title"
- app:fragment="ml.docilealligator.infinityforreddit.settings.NumberOfColumnsInPostFeedPreferenceFragment" />
-
- <PreferenceCategory
- app:title="@string/settings_category_comment_title" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="show_top_level_comments_first"
- app:title="@string/settings_show_top_level_comments_first_title" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="show_comment_divider"
- app:title="@string/settings_show_comment_divider_title" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="comment_toolbar_hidden"
- app:title="@string/settings_comment_toolbar_hidden" />
-
- <SwitchPreference
- app:defaultValue="true"
- app:key="comment_toolbar_hide_on_click"
- app:title="@string/settings_comment_toolbar_hide_on_click" />
-
- <SwitchPreference
- app:defaultValue="false"
- app:key="fully_collapse_comment"
- android:title="@string/settings_fully_collapse_comment_title" />
-
-</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/interface_preferences.xml b/app/src/main/res/xml/interface_preferences.xml
new file mode 100644
index 00000000..d6f8dc68
--- /dev/null
+++ b/app/src/main/res/xml/interface_preferences.xml
@@ -0,0 +1,62 @@
+<?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">
+
+ <Preference
+ app:title="@string/settings_font_title"
+ app:icon="@drawable/ic_font_size_24dp"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.FontPreferenceFragment" />
+
+ <Preference
+ app:key="immersive_interface_entry"
+ app:title="@string/settings_immersive_interface_title"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.ImmersiveInterfacePreferenceFragment"
+ app:isPreferenceVisible="false" />
+
+ <Preference
+ app:title="@string/settings_customize_tabs_in_main_page_title"
+ app:summary="@string/only_for_logged_in_user"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.CustomizeMainPageTabsFragment" />
+
+ <Preference
+ app:title="@string/settings_customize_bottom_app_bar_title"
+ app:summary="@string/only_for_logged_in_user"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.CustomizeBottomAppBarFragment" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="bottom_app_bar"
+ 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" />
+
+ <Preference
+ app:title="@string/settings_category_post_title"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.PostPreferenceFragment" />
+
+ <Preference
+ app:title="@string/settings_category_comment_title"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.CommentPreferenceFragment" />
+
+ <PreferenceCategory
+ app:title="@string/settings_category_post_and_comment_title" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="vote_buttons_on_the_right"
+ app:title="@string/settings_vote_buttons_on_the_right_title" />
+
+ <SwitchPreference
+ app:defaultValue="true"
+ app:key="show_absolute_number_of_votes"
+ app:title="@string/settings_show_absolute_number_of_votes_title" />
+
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/number_of_columns_in_post_feed_preferences.xml b/app/src/main/res/xml/number_of_columns_in_post_feed_preferences.xml
index 356058da..5e91acff 100644
--- a/app/src/main/res/xml/number_of_columns_in_post_feed_preferences.xml
+++ b/app/src/main/res/xml/number_of_columns_in_post_feed_preferences.xml
@@ -1,12 +1,14 @@
<?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">
+
<Preference
android:icon="@drawable/ic_info_preference_24dp"
app:summary="@string/restart_app_see_changes"
app:enabled="false" />
- <PreferenceCategory />
+ <PreferenceCategory
+ android:title="@string/post_layout_card" />
<ListPreference
app:defaultValue="1"
@@ -23,4 +25,43 @@
app:key="number_of_columns_in_post_feed_landscape"
app:title="@string/settings_number_of_columns_in_post_feed_landscape_title"
app:useSimpleSummaryProvider="true" />
+
+ <PreferenceCategory
+ android:title="@string/post_layout_compact" />
+
+ <ListPreference
+ app:defaultValue="1"
+ app:entries="@array/settings_number_of_columns_in_post_feed"
+ app:entryValues="@array/settings_number_of_columns_in_post_feed"
+ app:key="number_of_columns_in_post_feed_portrait_compact_layout"
+ app:title="@string/settings_number_of_columns_in_post_feed_portrait_title"
+ app:useSimpleSummaryProvider="true" />
+
+ <ListPreference
+ app:defaultValue="2"
+ app:entries="@array/settings_number_of_columns_in_post_feed"
+ app:entryValues="@array/settings_number_of_columns_in_post_feed"
+ app:key="number_of_columns_in_post_feed_landscape_compact_layout"
+ app:title="@string/settings_number_of_columns_in_post_feed_landscape_title"
+ app:useSimpleSummaryProvider="true" />
+
+ <PreferenceCategory
+ android:title="@string/post_layout_gallery" />
+
+ <ListPreference
+ app:defaultValue="2"
+ app:entries="@array/settings_number_of_columns_in_post_feed"
+ app:entryValues="@array/settings_number_of_columns_in_post_feed"
+ app:key="number_of_columns_in_post_feed_portrait_gallery_layout"
+ app:title="@string/settings_number_of_columns_in_post_feed_portrait_title"
+ app:useSimpleSummaryProvider="true" />
+
+ <ListPreference
+ app:defaultValue="2"
+ app:entries="@array/settings_number_of_columns_in_post_feed"
+ app:entryValues="@array/settings_number_of_columns_in_post_feed"
+ app:key="number_of_columns_in_post_feed_landscape_gallery_layout"
+ app:title="@string/settings_number_of_columns_in_post_feed_landscape_title"
+ app:useSimpleSummaryProvider="true" />
+
</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/post_preferences.xml b/app/src/main/res/xml/post_preferences.xml
new file mode 100644
index 00000000..4c4b50aa
--- /dev/null
+++ b/app/src/main/res/xml/post_preferences.xml
@@ -0,0 +1,37 @@
+<?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">
+
+ <ListPreference
+ app:defaultValue="0"
+ android:entries="@array/settings_default_post_layout"
+ app:entryValues="@array/settings_default_post_layout_values"
+ app:key="default_post_layout"
+ app:title="@string/settings_default_post_layout"
+ app:useSimpleSummaryProvider="true" />
+
+ <SwitchPreference
+ app:defaultValue="true"
+ app:key="show_divider_in_compact_layout"
+ app:title="@string/settings_show_divider_in_compact_layout" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="show_thumbnail_on_the_left_in_compact_layout"
+ app:title="@string/settings_show_thumbnail_on_the_left_in_compact_layout" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="long_press_to_hide_toolbar_in_compact_layout"
+ app:title="@string/settings_long_press_to_hide_toolbar_in_compact_layout_title" />
+
+ <SwitchPreference
+ app:defaultValue="false"
+ app:key="post_compact_layout_toolbar_hidden_by_default"
+ app:title="@string/settings_post_compact_layout_toolbar_hidden_by_default_title" />
+
+ <Preference
+ app:title="@string/settings_number_of_columns_in_post_feed_title"
+ app:fragment="ml.docilealligator.infinityforreddit.settings.NumberOfColumnsInPostFeedPreferenceFragment" />
+
+</PreferenceScreen> \ No newline at end of file