Reputation: 682
According to the Material Design documentation, there is a "standard" and a "modal" version of the navigation drawer. The former is meant for tablets and the later is meant for smart phones.
I have an app, which uses a drawer to switch between several fragments, and since most fragments only contain simple lists, I would like to show both the open drawer and the visible fragment on tablets.
I have read a dozen similar questions here on SO, but all of them were years old, so I ping this topic again. Is there a built in, automatic way to switch between the standard and modal state depending on the screen size without messing too much with the source code?
Since Google pushes app compatibility on various devices, I expect them to have a solution which, even with alternative layouts, but can utilize the built in drawer handling implementation. Although, I have found nothing in the official documentations.
Upvotes: 1
Views: 509
Reputation: 8867
Is there a built in, automatic way to switch between the standard and modal state depending on the screen size without messing too much with the source code?
Actually, yes.
Create Layout resource file -> select "Smallest Screen Width" in "Available qualifiers" -> click ">>" and type in 600 -> "OK".
Determine whether to lock the Drawer in each Layout: https://stackoverflow.com/a/50646711/3466808
Upvotes: 1