Remove unused elements from navigation drawer

This makes it more accurate for Lemmy.
This commit is contained in:
Bazsalanszky 2023-08-04 10:08:08 +02:00
parent 15c1676d0b
commit 4bfe1b0c02
2 changed files with 9 additions and 27 deletions

View File

@ -24,8 +24,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 = 5;
private static final int ANONYMOUS_ACCOUNT_SECTION_ITEMS = 3;
private static final int ACCOUNT_SECTION_ITEMS = 4;
private static final int ANONYMOUS_ACCOUNT_SECTION_ITEMS = 2;
private BaseActivity baseActivity;
private int inboxCount;
@ -101,10 +101,6 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy
drawableId = R.drawable.ic_subscritptions_bottom_app_bar_24dp;
break;
case 3:
stringId = R.string.multi_reddit;
drawableId = R.drawable.ic_multi_reddit_24dp;
break;
case 4:
setOnClickListener = false;
if (inboxCount > 0) {
((MenuItemViewHolder) holder).menuTextView.setText(baseActivity.getString(R.string.inbox_with_count, inboxCount));
@ -118,23 +114,21 @@ public class AccountSectionRecyclerViewAdapter extends RecyclerView.Adapter<Recy
});
break;
default:
stringId = R.string.history;
drawableId = R.drawable.ic_history_24dp;
stringId = R.string.account_saved_thing_activity_label;
drawableId = R.drawable.ic_outline_bookmarks_24dp;
break;
}
} else {
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;
stringId = R.string.anonymous_account_instance;
drawableId = R.drawable.ic_account_circle_24dp;
break;
}
}

View File

@ -17,8 +17,6 @@ import eu.toldi.infinityforlemmy.subscribedsubreddit.SubscribedSubredditData;
public class NavigationDrawerRecyclerViewMergedAdapter {
private HeaderSectionRecyclerViewAdapter headerSectionRecyclerViewAdapter;
private AccountSectionRecyclerViewAdapter accountSectionRecyclerViewAdapter;
private RedditSectionRecyclerViewAdapter redditSectionRecyclerViewAdapter;
private PostSectionRecyclerViewAdapter postSectionRecyclerViewAdapter;
private PreferenceSectionRecyclerViewAdapter preferenceSectionRecyclerViewAdapter;
private FavoriteSubscribedSubredditsSectionRecyclerViewAdapter favoriteSubscribedSubredditsSectionRecyclerViewAdapter;
private SubscribedSubredditsRecyclerViewAdapter subscribedSubredditsRecyclerViewAdapter;
@ -49,10 +47,6 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
});
accountSectionRecyclerViewAdapter = new AccountSectionRecyclerViewAdapter(baseActivity, customThemeWrapper,
navigationDrawerSharedPreferences, accountName != null, itemClickListener);
redditSectionRecyclerViewAdapter = new RedditSectionRecyclerViewAdapter(baseActivity, customThemeWrapper,
navigationDrawerSharedPreferences, itemClickListener, accountName != null);
postSectionRecyclerViewAdapter = new PostSectionRecyclerViewAdapter(baseActivity, customThemeWrapper,
navigationDrawerSharedPreferences, accountName != null, itemClickListener);
preferenceSectionRecyclerViewAdapter = new PreferenceSectionRecyclerViewAdapter(baseActivity, customThemeWrapper,
accountName, nsfwAndSpoilerSharedPreferences, navigationDrawerSharedPreferences, itemClickListener);
favoriteSubscribedSubredditsSectionRecyclerViewAdapter = new FavoriteSubscribedSubredditsSectionRecyclerViewAdapter(
@ -65,8 +59,6 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
mainPageConcatAdapter = new ConcatAdapter(
headerSectionRecyclerViewAdapter,
accountSectionRecyclerViewAdapter,
redditSectionRecyclerViewAdapter,
postSectionRecyclerViewAdapter,
preferenceSectionRecyclerViewAdapter,
favoriteSubscribedSubredditsSectionRecyclerViewAdapter,
subscribedSubredditsRecyclerViewAdapter);
@ -78,8 +70,6 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
private void openAccountSection() {
mainPageConcatAdapter.removeAdapter(accountSectionRecyclerViewAdapter);
mainPageConcatAdapter.removeAdapter(redditSectionRecyclerViewAdapter);
mainPageConcatAdapter.removeAdapter(postSectionRecyclerViewAdapter);
mainPageConcatAdapter.removeAdapter(preferenceSectionRecyclerViewAdapter);
mainPageConcatAdapter.removeAdapter(favoriteSubscribedSubredditsSectionRecyclerViewAdapter);
mainPageConcatAdapter.removeAdapter(subscribedSubredditsRecyclerViewAdapter);
@ -91,8 +81,6 @@ public class NavigationDrawerRecyclerViewMergedAdapter {
mainPageConcatAdapter.removeAdapter(accountManagementSectionRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(accountSectionRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(redditSectionRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(postSectionRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(preferenceSectionRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(favoriteSubscribedSubredditsSectionRecyclerViewAdapter);
mainPageConcatAdapter.addAdapter(subscribedSubredditsRecyclerViewAdapter);