diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-07-15 03:54:08 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-07-15 03:54:08 +0000 |
commit | 0265ac6227d72cb2f4b80747afb151d2e3701956 (patch) | |
tree | 1bdb5d853738becd9e154f96f93d23fbfa9b558f | |
parent | e6acd1bafcff3eef1204daec42442340e0134b52 (diff) | |
download | infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.tar infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.tar.gz infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.tar.bz2 infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.tar.lz infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.tar.xz infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.tar.zst infinity-for-reddit-0265ac6227d72cb2f4b80747afb151d2e3701956.zip |
Add an option for History in the navigation drawer.
3 files changed, 23 insertions, 13 deletions
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<Recy private static final int VIEW_TYPE_MENU_GROUP_TITLE = 1; private static final int VIEW_TYPE_MENU_ITEM = 2; - private static final int ACCOUNT_SECTION_ITEMS = 4; - private static final int ANONYMOUS_ACCOUNT_SECTION_ITEMS = 2; + private static final int ACCOUNT_SECTION_ITEMS = 5; + private static final int ANONYMOUS_ACCOUNT_SECTION_ITEMS = 3; private BaseActivity baseActivity; private int inboxCount; @@ -105,7 +105,7 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy stringId = R.string.multi_reddit; drawableId = R.drawable.ic_multi_reddit_24dp; break; - default: + case 4: setOnClickListener = false; if (inboxCount > 0) { ((MenuItemViewHolder) holder).menuTextView.setText(baseActivity.getString(R.string.inbox_with_count, inboxCount)); @@ -118,15 +118,24 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy baseActivity.startActivity(intent); }); break; + default: + stringId = R.string.history; + drawableId = R.drawable.ic_history_24dp; } } else { - if (position == 1) { - stringId = R.string.subscriptions; - drawableId = R.drawable.ic_subscritptions_bottom_app_bar_24dp; - } else { - stringId = R.string.multi_reddit; - drawableId = R.drawable.ic_multi_reddit_24dp; + switch (position) { + case 1: + stringId = R.string.subscriptions; + drawableId = R.drawable.ic_subscritptions_bottom_app_bar_24dp; + break; + case 2: + stringId = R.string.multi_reddit; + drawableId = R.drawable.ic_multi_reddit_24dp; + break; + default: + stringId = R.string.history; + drawableId = R.drawable.ic_history_24dp; } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9fb9f6bb..f4914ca3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -135,6 +135,7 @@ <string name="profile">Profile</string> <string name="subscriptions">Subscriptions</string> <string name="multi_reddit">Multireddit</string> + <string name="history">History</string> <string name="inbox">Inbox</string> <string name="inbox_with_count">Inbox (%1$,d)</string> <string name="rpan">RPAN</string> |