diff options
author | Hermes Junior <ohermesjunior@gmail.com> | 2020-06-17 17:23:13 +0000 |
---|---|---|
committer | OHermesJunior <ohermesjunior@gmail.com> | 2020-06-17 17:23:13 +0000 |
commit | 09538f4600d9106421f3311d69c5fbae9ab90cf5 (patch) | |
tree | 03762b2bde28bd05b0eb182de15a1e2c6f98d371 /app/src/main/java/ml/docilealligator | |
parent | b5fec7dac7e559391a95adb4342790fa54b172f9 (diff) | |
download | infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.tar infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.tar.gz infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.tar.bz2 infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.tar.lz infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.tar.xz infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.tar.zst infinity-for-reddit-09538f4600d9106421f3311d69c5fbae9ab90cf5.zip |
Add preferences label and divider in nav drawer.
Diffstat (limited to 'app/src/main/java/ml/docilealligator')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java index 0491c1ed..7d038fa0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/NavigationDrawerRecyclerViewAdapter.java @@ -42,7 +42,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re private static final int VIEW_TYPE_DIVIDER = 3; private static final int VIEW_TYPE_SUBSCRIBED_SUBREDDIT = 4; private static final int VIEW_TYPE_ACCOUNT = 5; - private static final int CURRENT_MENU_ITEMS = 16; + private static final int CURRENT_MENU_ITEMS = 17; private Context context; private Resources resources; @@ -90,9 +90,9 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re return VIEW_TYPE_SUBSCRIBED_SUBREDDIT; } else if (position == 0) { return VIEW_TYPE_NAV_HEADER; - } else if (position == 1 || position == 6) { + } else if (position == 1 || position == 6 || position == 12) { return VIEW_TYPE_MENU_GROUP_TITLE; - } else if (position == 12) { + } else if (position == 16) { return VIEW_TYPE_DIVIDER; } else { return VIEW_TYPE_MENU_ITEM; @@ -214,6 +214,8 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.label_account); } else if (position == 6) { ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.label_post); + } else if (position == 12) { + ((MenuGroupTitleViewHolder) holder).titleTextView.setText(R.string.label_preferences); } } else if (holder instanceof MenuItemViewHolder) { int stringId = 0; @@ -401,7 +403,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re if (subscribedSubreddits != null) { return CURRENT_MENU_ITEMS + subscribedSubreddits.size(); } - return CURRENT_MENU_ITEMS; + return CURRENT_MENU_ITEMS - 1; } else { return 4; } @@ -448,7 +450,7 @@ public class NavigationDrawerRecyclerViewAdapter extends RecyclerView.Adapter<Re this.isNSFWEnabled = isNSFWEnabled; if (isInMainPage) { if (isLoggedIn) { - notifyItemChanged(CURRENT_MENU_ITEMS - 2); + notifyItemChanged(CURRENT_MENU_ITEMS - 3); } else { notifyItemChanged(2); } |