use of org.fossasia.openevent.common.ui.SmoothActionBarDrawerToggle in project open-event-android by fossasia.
the class MainActivity method setUpNavDrawer.
private void setUpNavDrawer() {
setUpUserProfileMenu();
headerView = navigationView.getHeaderView(0).findViewById(R.id.headerDrawer);
if (!isTwoPane) {
final ActionBar ab = getSupportActionBar();
if (ab == null)
return;
SmoothActionBarDrawerToggle smoothActionBarToggle = new SmoothActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) {
@Override
public void onDrawerStateChanged(int newState) {
super.onDrawerStateChanged(newState);
if (toolbar.getTitle().equals(getString(R.string.menu_about))) {
navigationView.setCheckedItem(R.id.nav_home);
}
}
};
if (drawerLayout != null) {
drawerLayout.addDrawerListener(smoothActionBarToggle);
}
ab.setDisplayHomeAsUpEnabled(true);
smoothActionBarToggle.syncState();
} else if (toolbar.getTitle().equals(getString(R.string.menu_about))) {
navigationView.setCheckedItem(R.id.nav_home);
}
}
Aggregations