aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-10-28 00:59:57 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-10-28 00:59:57 +0000
commit84e4dd09c3bb585c4cfc4166c9f9207610458cf2 (patch)
tree1b5d613124bbdecb4cc246117a5a76d205359b91 /app/src/main/res
parente1b0b568ec21be256318d387ed2809ed3dc45b63 (diff)
downloadinfinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.tar
infinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.tar.gz
infinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.tar.bz2
infinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.tar.lz
infinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.tar.xz
infinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.tar.zst
infinity-for-reddit-84e4dd09c3bb585c4cfc4166c9f9207610458cf2.zip
Add an option to filter subreddits in popular and all.
Diffstat (limited to '')
-rw-r--r--app/src/main/res/drawable-night/ic_filter_24dp.xml9
-rw-r--r--app/src/main/res/drawable/ic_filter_24dp.xml9
-rw-r--r--app/src/main/res/layout/activity_subreddit_filter_popular_and_all.xml52
-rw-r--r--app/src/main/res/layout/item_selected_subreddit.xml6
-rw-r--r--app/src/main/res/values/strings.xml4
-rw-r--r--app/src/main/res/xml/filter_preferences.xml11
-rw-r--r--app/src/main/res/xml/main_preferences.xml5
7 files changed, 95 insertions, 1 deletions
diff --git a/app/src/main/res/drawable-night/ic_filter_24dp.xml b/app/src/main/res/drawable-night/ic_filter_24dp.xml
new file mode 100644
index 00000000..641119c4
--- /dev/null
+++ b/app/src/main/res/drawable-night/ic_filter_24dp.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#FFFFFF"
+ android:pathData="M7,6h10l-5.01,6.3L7,6zM4.25,5.61C6.27,8.2 10,13 10,13v6c0,0.55 0.45,1 1,1h2c0.55,0 1,-0.45 1,-1v-6c0,0 3.72,-4.8 5.74,-7.39C20.25,4.95 19.78,4 18.95,4H5.04C4.21,4 3.74,4.95 4.25,5.61z"/>
+</vector>
diff --git a/app/src/main/res/drawable/ic_filter_24dp.xml b/app/src/main/res/drawable/ic_filter_24dp.xml
new file mode 100644
index 00000000..869e7e5e
--- /dev/null
+++ b/app/src/main/res/drawable/ic_filter_24dp.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="#000000"
+ android:pathData="M7,6h10l-5.01,6.3L7,6zM4.25,5.61C6.27,8.2 10,13 10,13v6c0,0.55 0.45,1 1,1h2c0.55,0 1,-0.45 1,-1v-6c0,0 3.72,-4.8 5.74,-7.39C20.25,4.95 19.78,4 18.95,4H5.04C4.21,4 3.74,4.95 4.25,5.61z"/>
+</vector>
diff --git a/app/src/main/res/layout/activity_subreddit_filter_popular_and_all.xml b/app/src/main/res/layout/activity_subreddit_filter_popular_and_all.xml
new file mode 100644
index 00000000..6a342718
--- /dev/null
+++ b/app/src/main/res/layout/activity_subreddit_filter_popular_and_all.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/coordinator_layout_subreddit_filter_popular_and_all_activity"
+ tools:context=".Activity.SubredditFilterPopularAndAllActivity">
+
+ <com.google.android.material.appbar.AppBarLayout
+ android:id="@+id/appbar_layout_subreddit_filter_popular_and_all_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/AppTheme.AppBarOverlay">
+
+ <com.google.android.material.appbar.CollapsingToolbarLayout
+ android:id="@+id/collapsing_toolbar_layout_subreddit_filter_popular_and_all_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_scrollFlags="scroll|enterAlways"
+ app:titleEnabled="false"
+ app:toolbarId="@+id/toolbar_subreddit_filter_popular_and_all_activity">
+
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar_subreddit_filter_popular_and_all_activity"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="?attr/actionBarSize"
+ app:popupTheme="@style/AppTheme.PopupOverlay"
+ app:navigationIcon="?attr/homeAsUpIndicator" />
+
+ </com.google.android.material.appbar.CollapsingToolbarLayout>
+
+ </com.google.android.material.appbar.AppBarLayout>
+
+ <androidx.recyclerview.widget.RecyclerView
+ android:id="@+id/recycler_view_subreddit_filter_popular_and_all_activity"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+
+ <com.google.android.material.floatingactionbutton.FloatingActionButton
+ android:id="@+id/fab_subreddit_filter_popular_and_all_activity"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_margin="@dimen/fab_margin"
+ android:layout_gravity="bottom|end"
+ app:backgroundTint="?attr/colorPrimaryLightTheme"
+ app:srcCompat="@drawable/ic_add_day_night_24dp"
+ app:tint="@android:color/white" />
+
+</androidx.coordinatorlayout.widget.CoordinatorLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/item_selected_subreddit.xml b/app/src/main/res/layout/item_selected_subreddit.xml
index 6e1a570a..2e8ae1c9 100644
--- a/app/src/main/res/layout/item_selected_subreddit.xml
+++ b/app/src/main/res/layout/item_selected_subreddit.xml
@@ -15,6 +15,7 @@
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:textSize="?attr/font_default"
+ android:textColor="?attr/primaryTextColor"
android:fontFamily="?attr/font_family" />
<ImageView
@@ -22,6 +23,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:src="@drawable/ic_delete_24dp" />
+ android:src="@drawable/ic_delete_24dp"
+ android:clickable="true"
+ android:focusable="true"
+ android:background="?attr/selectableItemBackground" />
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 0375432b..f5d3bdec 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -33,6 +33,7 @@
<string name="view_reddit_gallery_activity_video_label">Video %1$d/%2$d</string>
<string name="submit_crosspost_activity_label">Crosspost</string>
<string name="give_award_activity_label">Give Award</string>
+ <string name="subreddit_filter_popular_and_all_activity_label">r/all and r/popular</string>
<string name="navigation_drawer_open">Open navigation drawer</string>
<string name="navigation_drawer_close">Close navigation drawer</string>
@@ -497,6 +498,9 @@
<string name="settings_miscellaneous_title">Miscellaneous</string>
<string name="settings_respect_subreddit_recommended_comment_sort_type_title">Respect Subreddit Recommended Comment Sort Type</string>
<string name="settings_respect_subreddit_recommended_comment_sort_type_summary">Comment sort type will not be saved</string>
+ <string name="settings_filter_title">Filter</string>
+ <string name="settings_subreddit_filter_category">Subreddit Filter</string>
+ <string name="settings_subreddit_filter_popular_and_all">r/popular and r/all</string>
<string name="no_link_available">Cannot get the link</string>
diff --git a/app/src/main/res/xml/filter_preferences.xml b/app/src/main/res/xml/filter_preferences.xml
new file mode 100644
index 00000000..a0e2a991
--- /dev/null
+++ b/app/src/main/res/xml/filter_preferences.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <PreferenceCategory
+ app:title="@string/settings_subreddit_filter_category" />
+
+ <Preference
+ app:key="subreddit_filter_popular_and_all"
+ app:title="@string/settings_subreddit_filter_popular_and_all" />
+
+</PreferenceScreen> \ No newline at end of file
diff --git a/app/src/main/res/xml/main_preferences.xml b/app/src/main/res/xml/main_preferences.xml
index 8ada3e6c..1dea4177 100644
--- a/app/src/main/res/xml/main_preferences.xml
+++ b/app/src/main/res/xml/main_preferences.xml
@@ -59,6 +59,11 @@
app:fragment="ml.docilealligator.infinityforreddit.Settings.NsfwAndBlurringFragment"/>
<Preference
+ app:icon="@drawable/ic_filter_24dp"
+ app:title="@string/settings_filter_title"
+ app:fragment="ml.docilealligator.infinityforreddit.Settings.FilterPreferenceFragment"/>
+
+ <Preference
app:icon="@drawable/ic_miscellaneous_24dp"
app:title="@string/settings_miscellaneous_title"
app:fragment="ml.docilealligator.infinityforreddit.Settings.MiscellaneousPreferenceFragment"/>