I have a sliding drawer menu in an activity, which has an actionbar with some tabs on it.
I\'d like to get the sliding drawer to slide over the tabs , not below th
I managed to achieve this requirement by setting the navigationMode inside OnDrawerClosed and onDrawerOpened functions. It is a temp fix since the tabs actually do not disappear immediately.
public void onDrawerClosed(View view) {
getActionBar().setTitle(mTitle);
if(getActionBar().getTabCount()>0) //Add tabs when the fragment has it
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
...
}
public void onDrawerOpened(View drawerView) {
getActionBar().setTitle(mDrawerTitle);
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
..
}
If you have some fragments with tabs, and other without it don't forget to remove tabs onCreateView of fragment that does not have tabs.
getActionBar().removeAllTabs();
I have use tabs inside fragment of drawer. I solve this problem adding
getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
in onDrawerClosed()
and getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
in onDrawerOpend()
method.
I hope this will help you.
you can use below libraries to get navigation model similar to Google play music app.
I have created a project Navigation Drawer with Tab Strip Example at github, have a look at it.
Below is the screenshot of it.
I had the same problem, but the only solution I found was to use tabs inside the inner fragment (not fragmentActivity). I don't know if it was the best solution, the only problem i had was styling this tabs, for the rest, it works perfectly