tasomaniac
tasomaniac

Reputation: 10342

New NavigationDrawer on tablets with fixed left layout

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?

Upvotes: 4

Views: 1882

Answers (1)

Sergiy Khruschak
Sergiy Khruschak

Reputation: 81

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);
}

Upvotes: 4

Related Questions