Fix Lemmy section in NavDrawer

This commit is contained in:
Balazs Toldi 2023-07-30 20:12:43 +02:00
parent de3bea0729
commit d47e2dac92
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -22,7 +22,9 @@ public class RedditSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
private static final int VIEW_TYPE_MENU_GROUP_TITLE = 1; private static final int VIEW_TYPE_MENU_GROUP_TITLE = 1;
private static final int VIEW_TYPE_MENU_ITEM = 2; private static final int VIEW_TYPE_MENU_ITEM = 2;
private static final int REDDIT_SECTION_ITEMS = 2; private static final int REDDIT_SECTION_ITEMS = 1;
private static final int REDDIT_SECTION_ANONYMOUS_ITEMS = 2;
private final boolean isLoggedIn; private final boolean isLoggedIn;
private BaseActivity baseActivity; private BaseActivity baseActivity;
@ -104,7 +106,7 @@ public class RedditSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recyc
@Override @Override
public int getItemCount() { public int getItemCount() {
return isLoggedIn ? (REDDIT_SECTION_ITEMS + 1) - 1 : collapseRedditSection ? 1 : REDDIT_SECTION_ITEMS + 1; return !collapseRedditSection ? (isLoggedIn ? REDDIT_SECTION_ITEMS + 1 : REDDIT_SECTION_ANONYMOUS_ITEMS + 1) : 1;
} }
class MenuGroupTitleViewHolder extends RecyclerView.ViewHolder { class MenuGroupTitleViewHolder extends RecyclerView.ViewHolder {