aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-10-09 10:54:09 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-10-09 10:54:09 +0000
commitff69387221128d0b541f222041ce8d51dd2fd8b3 (patch)
treebc827593837c7108e36bfeca4e17be8f53b1a93f /app
parent7feb78f133961a589b5ceefc9864b5e11c8d5b90 (diff)
downloadinfinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.tar
infinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.tar.gz
infinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.tar.bz2
infinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.tar.lz
infinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.tar.xz
infinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.tar.zst
infinity-for-reddit-ff69387221128d0b541f222041ce8d51dd2fd8b3.zip
Filter posts option in toolbar.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java7
-rw-r--r--app/src/main/res/menu/post_fragment.xml6
2 files changed, 13 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
index a1c76724..2b6dedf3 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java
@@ -1288,6 +1288,10 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
} else {
lazyModeItem.setTitle(R.string.action_start_lazy_mode);
}
+
+ if (activity instanceof FilteredPostsActivity) {
+ menu.findItem(R.id.action_filter_posts_post_fragment).setVisible(false);
+ }
}
@Override
@@ -1299,6 +1303,9 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
startLazyMode();
}
return true;
+ } else if (item.getItemId() == R.id.action_filter_posts_post_fragment) {
+ filterPosts();
+ return true;
}
return false;
}
diff --git a/app/src/main/res/menu/post_fragment.xml b/app/src/main/res/menu/post_fragment.xml
index d29054d3..fc648460 100644
--- a/app/src/main/res/menu/post_fragment.xml
+++ b/app/src/main/res/menu/post_fragment.xml
@@ -5,4 +5,10 @@
android:id="@+id/action_lazy_mode_post_fragment"
android:orderInCategory="100"
app:showAsAction="never" />
+
+ <item
+ android:id="@+id/action_filter_posts_post_fragment"
+ android:orderInCategory="101"
+ android:title="@string/filter_posts"
+ app:showAsAction="never" />
</menu> \ No newline at end of file