From ff69387221128d0b541f222041ce8d51dd2fd8b3 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sat, 9 Oct 2021 18:54:09 +0800 Subject: Filter posts option in toolbar. --- .../docilealligator/infinityforreddit/fragments/PostFragment.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/src/main/java/ml') 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; } -- cgit v1.2.3