Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between SlidingPaneLayout and NavigationDrawer

I really don't know what is the difference between these two approaches of creating navigation menu. So I read that both can be used as a container for two fragments (main fragment, detail fragment). So can you help me to understand which approach is better and why? I can't find out relevant information.

thank you.

like image 349
feromakovi Avatar asked May 28 '13 21:05

feromakovi


2 Answers

The session was "Android Design for UI Developers" by Roman Nurik and Nick Butcher: https://developers.google.com/events/io/sessions/326204977

Pretty much what CommonsWare said, essentially, Navigation Drawer is for chrome and top level navigation, so it overlays app content. SlidingPaneLayout is for content navigation, thus it doesn't overlay content.

EDIT: The video is still available here - https://www.youtube.com/watch?v=Jl3-lzlzOJI

like image 133
Yuntao Avatar answered Oct 18 '22 05:10

Yuntao


So can you help me to understand which approach is better and why? I can't find out relevant information.

This was covered in a Google I|O 2013 presentation, though I forget which one.

SlidingPaneLayout is for content, such as the master-detail pattern. You might use it in place of two layouts for master-detail structures for smaller and larger screens.

DrawerLayout is for navigation. You might use it in place of the dashboard pattern, or using action bar items for navigation, if you have a fair bit of navigation in your app.

like image 7
CommonsWare Avatar answered Oct 18 '22 05:10

CommonsWare