Override method for when nav drawer opens/closes to hide/show action bar items
This commit is contained in:
@ -79,10 +79,15 @@ public class I2PActivityBase extends ActionBarActivity {
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
// If the nav drawer is open, hide action items related to the content view
|
||||
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
|
||||
//menu.findItem(R.id.action_add_to_addressbook).setVisible(!drawerOpen);
|
||||
onDrawerChange(drawerOpen);
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
protected void onDrawerChange(boolean drawerOpen) {
|
||||
// Override in subclass with e.g.
|
||||
//menu.findItem(R.id.action_add_to_addressbook).setVisible(!drawerOpen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// The action bar home/up action should open or close the drawer.
|
||||
|
Reference in New Issue
Block a user