From 0265ac6227d72cb2f4b80747afb151d2e3701956 Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Fri, 15 Jul 2022 11:54:08 +0800 Subject: Add an option for History in the navigation drawer. --- .../infinityforreddit/activities/MainActivity.java | 8 +++---- .../AccountSectionRecyclerViewAdapter.java | 27 ++++++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 31d7dd33..d4d90784 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -733,13 +733,11 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } }); navigationWrapper.floatingActionButton.setOnLongClickListener(view -> { - /*FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment= new FABMoreOptionsBottomSheetFragment(); + FABMoreOptionsBottomSheetFragment fabMoreOptionsBottomSheetFragment= new FABMoreOptionsBottomSheetFragment(); Bundle bundle = new Bundle(); bundle.putBoolean(FABMoreOptionsBottomSheetFragment.EXTRA_ANONYMOUS_MODE, mAccessToken == null); fabMoreOptionsBottomSheetFragment.setArguments(bundle); - fabMoreOptionsBottomSheetFragment.show(getSupportFragmentManager(), fabMoreOptionsBottomSheetFragment.getTag());*/ - Intent intent = new Intent(this, HistoryActivity.class); - startActivity(intent); + fabMoreOptionsBottomSheetFragment.show(getSupportFragmentManager(), fabMoreOptionsBottomSheetFragment.getTag()); return true; }); navigationWrapper.floatingActionButton.setVisibility(View.VISIBLE); @@ -762,6 +760,8 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } else if (stringId == R.string.multi_reddit) { intent = new Intent(MainActivity.this, SubscribedThingListingActivity.class); intent.putExtra(SubscribedThingListingActivity.EXTRA_SHOW_MULTIREDDITS, true); + } else if (stringId == R.string.history) { + intent = new Intent(MainActivity.this, HistoryActivity.class); } else if (stringId == R.string.rpan) { intent = new Intent(MainActivity.this, RPANActivity.class); } else if (stringId == R.string.trending) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/AccountSectionRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/AccountSectionRecyclerViewAdapter.java index 16de7142..d2934152 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/AccountSectionRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/AccountSectionRecyclerViewAdapter.java @@ -25,8 +25,8 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter 0) { ((MenuItemViewHolder) holder).menuTextView.setText(baseActivity.getString(R.string.inbox_with_count, inboxCount)); @@ -118,15 +118,24 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter