aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorDocile-Alligator <chineseperson5@gmail.com>2022-07-15 03:54:08 +0000
committerDocile-Alligator <chineseperson5@gmail.com>2022-07-15 03:54:08 +0000
commit0265ac6227d72cb2f4b80747afb151d2e3701956 (patch)
tree1bdb5d853738becd9e154f96f93d23fbfa9b558f /app/src/main/java
parente6acd1bafcff3eef1204daec42442340e0134b52 (diff)
downloadinfinity-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.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java8
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/navigationdrawer/AccountSectionRecyclerViewAdapter.java27
2 files changed, 22 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;
}
}