I have set up my app with a left and a right side navigation drawer. Everything works great except for one thing.
I would like my other actionbar item to toggle the right navigation drawer. The normal left ActionBarDrawerToggle works great. The Google+ android app notification panel is what I would like the action to mimic.
Here's the code I have for setting up the right side toggle (right now it force closes when clicked):
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
if (mDrawerLayout.isDrawerOpen(mLeftDrawer)) {
mDrawerLayout.closeDrawer(mLeftDrawer);
} else {
mDrawerLayout.openDrawer(mLeftDrawer);
}
return true;
// Right Drawer Toggle
case R.id.openRd:
if (mDrawerLayout.isDrawerOpen(mRightDrawer)) {
mDrawerLayout.closeDrawer(mRightDrawer);
}
mDrawerLayout.openDrawer(mRightDrawer);
}
return true;
}
If anyone knows how to do this, it would be great if you could let me know!
Thanks!