4

I could not find a way to do a tablet multi-pane layout easily with NavigationDrawer. Play Music app does that.

I have used LOCK_MODE_LOCKED_OPENED but it opens the drawer on top of the content as expected and it cannot be closed. Therefore the content is not completely visible.

Do we have to do it manually?

tasomaniac
  • 10,234
  • 6
  • 52
  • 84
  • Possible duplicate of [Navigation Drawer: set as always opened on tablets](https://stackoverflow.com/questions/17133541/navigation-drawer-set-as-always-opened-on-tablets) – Bertram Gilfoyle Jun 01 '18 at 17:07

1 Answers1

4

The only way we found is to do it manually, we created a simple linear layout for tablet and check the view instance in activity:

View layout = findViewById(R.id.navigation_layout);

if (layout instanceof DrawerLayout) {
  drawerLayout = (DrawerLayout) layout;
  // initialization of drawer toggle etc.
  ...
} else {
  // linear layout
  getSupportActionBar().setHomeButtonEnabled(false);
}
  • 2
    I have also done it manually. I guess there is no auto way to do that. Shame on Google! They are saying that NavigationDrawer is essential part of tablet layouts and they should be fixed. They are also using it in many apps but they were lazy to implement it. – tasomaniac Jun 04 '13 at 13:21