简体   繁体   中英

Navigation Drawer, concept problems

This is my first question. I would like to ask your opinion about Navigation Drawer. I've tried some projects and I've read lot of information about it, but somehow I can't really understand how it really works.. Here are my reasons/doubts:

  • Theoretically, you could go to anywhere of your App from anywhere, I mean, this concept forces the designer to work only with Fragments, converting your one and only Activity in a sort of 'God concept', which it is not the best idea in order to develop an App with deep navigation..

  • If there is a way to combine Navigation Drawer and Activities, should I implement on every Activity the same Navigation Drawer over and over? I can't really see this..

I'm talking about this because I'm trying to adapt one of my Apps and use this kind of navigation pattern on it, but I can't really see how to do it.. I still think that it is better to have multiples Activities, and of course, Fragments on them, but I don't know how to combine them in order to get the best performance of the Navigation Drawer. I have seen similar questions on this site, but I haven't found the answer I'm looking for. Maybe I haven't read enough documentation, or maybe I'm wrong and I haven't understood how this pattern really works..

Thanks for your help.

You can use the Navigation Drawer with activities just fine.

Just create a BaseActivity class that implements the drawer,
and let all your other activities extend this one.

A simple reason to use navigation drawer: efficiency .

First, navigation drawer is not an activity. It is just a layout that you can easily slide in and out of view. Of course, it is really a matter of intuitive implementation so there is no absolute answer to when or when not to use a drawer. If you feel user could be empowered by that UI flow, then it is worth to do it.

If you have problem in implementing the pattern, then you should start with baby step and learn from the official docs .

There's nothing wrong with having one activity that contains your navigation drawer and swaps fragments in and out as you navigate the menu drawer. Additionally, "going anywhere" in your application from the Navigation Drawer shouldn't be a concern if you have good navigation. Good navigation for a Navigation Drawer is probably broken into top level views and detail views . Your top level views are groups of content, which you would likely place in your Navigation Drawer.

A good example of this is the Google Plus Android application. There is one main activity and the navigation drawer provides all of the top level views, which are fragments that are swapped in and out of the main activity. As you dive into content further, you get the detail views, which are activities.

Have a look at the official design documentation for App Structure and Navigation Drawer for more information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM