It seems to me that one thing is missing from the DrawerLayout
implementation: and event that fires before the drawer opens.
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.drawable.ic_drawer, R.string.drawer_open, R.string.drawer_close) {
public void onDrawerClosed(View view) {
//...
}
public void onBeforeDrawerOpened(View drawerView) {
//...
}
public void onDrawerOpened(View drawerView) {
//...
}
};
The reason for needing it would be to set up the status of the drawer items like menu items selected, enabled and similar. Putting this into the onDrawerOpened()
callback kinda works but it doesn't look really right to change the menu appearance after it opens.
My first thought would be to extend ActionBarDrawerToggle
and provide the new event. Shall I re-invent the wheel :-) or has this already been done by somebody?