Readded instance switcher to navbar for anonymous accounts

This commit is contained in:
Balazs Toldi 2023-08-19 16:56:55 +02:00
parent 0550219d58
commit 0384914c16
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -24,7 +24,7 @@ public class LemmySectionRecyclerViewAdapter extends RecyclerView.Adapter<Recycl
private static final int VIEW_TYPE_MENU_ITEM = 2;
private static final int LEMMY_SECTION_ITEMS = 2;
private static final int LEMMY_SECTION_ANONYMOUS_ITEMS = 1;
private static final int LEMMY_SECTION_ANONYMOUS_ITEMS = 2;
private final boolean isLoggedIn;
private BaseActivity baseActivity;
@ -93,9 +93,15 @@ public class LemmySectionRecyclerViewAdapter extends RecyclerView.Adapter<Recycl
drawableId = R.drawable.ic_baseline_info_24;
break;
case 2:
if (isLoggedIn) {
stringId = R.string.blocks;
drawableId = R.drawable.ic_outline_lock_24dp;
break;
} else {
stringId = R.string.anonymous_account_instance;
drawableId = R.drawable.ic_account_circle_24dp;
break;
}
}
((MenuItemViewHolder) holder).menuTextView.setText(stringId);