fragmentManager = new FuckingFragmentManager(this, R.id.container);
navigation.setNavigationItemSelectedListener(menuItem -> {
if (switchFragment(menuItem.getItemId())) {
drawer.closeDrawers();
return true;
} else {
return false;
}
});
private boolean switchFragment(@IdRes int id) {
switch (id) {
case R.id.home:
fragmentManager.switchTo(FeedFragment.class);
return true;
case R.id.explore:
fragmentManager.switchTo(ExploreFragment.class);
return true;
default:
return false;
}
}