having tried several methods for implementing a Navigation Drawer which is only active on small screen sizes while having its contents always-visible on tablets, I am stuck at the beginning again.
This is what I’ve tried:
- I found approaches which try to make the Navigation Drawer itself always-visible.
- Many solutions use third-party repositories. I wonder why this is the case as Lollipop has the built-in Navigation Drawer.
- The original Android sample for the Nav-Drawer uses methods which are deprecated, like setNavigationMode(). In order to be future-proof, I would like to avoid such things.
In summary:
My favorite approach would use the Android Navigation Drawer for small screen sizes and the same content in a fragment for tablets (for redundancy avoidance).
So maybe one fragment file. In case of a small screen it is included in a sliding Navigation Drawer and in case of larger screens it is shown directly and always visible at the tablet’s left screen side.
My question: How to make Android include a fragment in a Navigation Drawer if a small screen is present and how to make it included in the root layout for tablets?
Thanks in advance!