I've implemented a DrawerLayout
with this tutorial and everything works fine.
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
// if nav drawer is opened, hide the action items
boolean drawerOpen = mDrawerLayout.isDrawerOpen(mDrawerList);
menu.findItem(R.id.action_settings).setVisible(!drawerOpen);
return super.onPrepareOptionsMenu(menu);
}
onPrepareOptionsMenu
simply toggles the menu visibility in one shot. But I'd like to slowly animate the alpha value of my menu items as the drawer slides.
A really simple way to accomplish this is to utilize
View.findViewsWithText
. Here's a quick example:Results
http://www.gfycat.com/BriskLiquidGaur