So I have tabs that I want to hide when the Navigation Drawer starts opening. The code I have hides them when it finished opening, but it's not what I want.
mDrawerToggle = new ActionBarDrawerToggle(
this,
mDrawerLayout,
R.drawable.ic_drawer,
R.string.drawer_open,
R.string.drawer_close
) {
@Override
public void onDrawerClosed(View view) {
invalidateOptionsMenu();
setActionBarMode(ActionBar.NAVIGATION_MODE_TABS);
}
@Override
public void onDrawerOpened(View drawerView) {
invalidateOptionsMenu();
setActionBarMode(ActionBar.NAVIGATION_MODE_STANDARD);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
Here's what I tried:
- Setting an
onClickListener
tomDrawerLayout
.onClick
never gets called - Setting an
onTouchListener
tomDrawerLayout
.onTouch
never gets called - Researched
ActionBarDrawerToggle
andDrawerLayout
classes. Could not find anything likeonDrawerStartedOpening
.
invalidateOptionsMenu();
has to be beforesetNavigationMode
. Everything else worked fine. Thanks! – Gunfire