Set toolbar title with categories names

This commit is contained in:
Shinokuni 2021-07-11 19:39:10 +02:00
parent 725c20a78e
commit 440e6ea810

View File

@ -256,14 +256,17 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
viewModel.setFilterType(FilterType.NO_FILTER); viewModel.setFilterType(FilterType.NO_FILTER);
scrollToTop = true; scrollToTop = true;
viewModel.invalidate(); viewModel.invalidate();
setTitle(R.string.articles);
break; break;
case DrawerManager.READ_LATER_ID: case DrawerManager.READ_LATER_ID:
viewModel.setFilterType(FilterType.READ_IT_LATER_FILTER); viewModel.setFilterType(FilterType.READ_IT_LATER_FILTER);
viewModel.invalidate(); viewModel.invalidate();
setTitle(R.string.read_later);
break; break;
case DrawerManager.STARS_ID: case DrawerManager.STARS_ID:
viewModel.setFilterType(FilterType.STARS_FILTER); viewModel.setFilterType(FilterType.STARS_FILTER);
viewModel.invalidate(); viewModel.invalidate();
setTitle(R.string.favorites);
break; break;
case DrawerManager.ABOUT_ID: case DrawerManager.ABOUT_ID:
startAboutActivity(); startAboutActivity();
@ -281,12 +284,14 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou
viewModel.setFilterFeedId((int) drawerItem.getIdentifier()); viewModel.setFilterFeedId((int) drawerItem.getIdentifier());
viewModel.setFilterType(FilterType.FEED_FILTER); viewModel.setFilterType(FilterType.FEED_FILTER);
viewModel.invalidate(); viewModel.invalidate();
setTitle(((SecondaryDrawerItem) drawerItem).getName().getText());
} else if (drawerItem instanceof CustomExpandableBadgeDrawerItem) { } else if (drawerItem instanceof CustomExpandableBadgeDrawerItem) {
drawer.closeDrawer(); drawer.closeDrawer();
viewModel.setFilerFolderId((int) (drawerItem.getIdentifier() / 1000)); viewModel.setFilerFolderId((int) (drawerItem.getIdentifier() / 1000));
viewModel.setFilterType(FilterType.FOLDER_FILER); viewModel.setFilterType(FilterType.FOLDER_FILER);
viewModel.invalidate(); viewModel.invalidate();
setTitle(((CustomExpandableBadgeDrawerItem) drawerItem).getName().getText());
} }
} }