More drawer tweaks
This commit is contained in:
parent
1cc7a6c5f2
commit
7939cd9adf
@ -411,6 +411,19 @@ public class IITC_Mobile extends Activity {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
if (mNavigationHelper != null) {
|
||||
boolean visible = !mNavigationHelper.isDrawerOpened();
|
||||
|
||||
for (int i = 0; i < menu.size(); i++)
|
||||
if (menu.getItem(i).getItemId() != R.id.action_settings)
|
||||
menu.getItem(i).setVisible(visible);
|
||||
}
|
||||
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
if (mNavigationHelper.onOptionsItemSelected(item))
|
||||
|
@ -140,12 +140,15 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnIt
|
||||
mActionBar.setHomeButtonEnabled(true);// Make icon clickable
|
||||
mDrawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);
|
||||
|
||||
if (mPane != Pane.MAP)
|
||||
setDrawerIndicatorEnabled(false);
|
||||
else
|
||||
if (mPane == Pane.MAP || mDrawerLayout.isDrawerOpen(mDrawerLeft))
|
||||
setDrawerIndicatorEnabled(true);
|
||||
else
|
||||
setDrawerIndicatorEnabled(false);
|
||||
}
|
||||
|
||||
if (mDrawerLayout.isDrawerOpen(mDrawerLeft))
|
||||
mActionBar.setTitle(mIitc.getString(R.string.app_name));
|
||||
else
|
||||
mActionBar.setTitle(getPaneTitle(mPane));
|
||||
}
|
||||
|
||||
@ -189,15 +192,15 @@ public class IITC_NavigationHelper extends ActionBarDrawerToggle implements OnIt
|
||||
|
||||
@Override
|
||||
public void onDrawerClosed(View drawerView) {
|
||||
// TODO change menu? (via invalidateOptionsMenu)
|
||||
super.onDrawerClosed(drawerView);
|
||||
mIitc.invalidateOptionsMenu();
|
||||
updateActionBar();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawerOpened(View drawerView) {
|
||||
// TODO change menu? (via invalidateOptionsMenu)
|
||||
super.onDrawerOpened(drawerView);
|
||||
mIitc.invalidateOptionsMenu();
|
||||
updateActionBar();
|
||||
mDrawerLayout.closeDrawer(drawerView.equals(mDrawerLeft) ? mDrawerRight : mDrawerLeft);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user