mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-05 21:39:50 +02:00
Add an option to filter subreddits in popular and all.
This commit is contained in:
9
app/src/main/res/drawable-night/ic_filter_24dp.xml
Normal file
9
app/src/main/res/drawable-night/ic_filter_24dp.xml
Normal file
@@ -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>
|
9
app/src/main/res/drawable/ic_filter_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_filter_24dp.xml
Normal file
@@ -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>
|
@@ -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>
|
@@ -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>
|
@@ -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>
|
||||
|
||||
|
11
app/src/main/res/xml/filter_preferences.xml
Normal file
11
app/src/main/res/xml/filter_preferences.xml
Normal file
@@ -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>
|
@@ -58,6 +58,11 @@
|
||||
app:title="@string/settings_nsfw_and_spoiler_title"
|
||||
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"
|
||||
|
Reference in New Issue
Block a user