I would like to implement a custom navigation drawer (such as the one shown here) and I have been trying all kinds of navigation menu libraries for Android and iOS but haven't come up with a good option. Is there any library that could achieve this kind of navigation or does anyone have any idea how this could be done as a custom component?
You can try SlidingMenu. Its one of the most widely used alternatives for navigation drawer. Its gives you a whole host of options which are listed on their homepage.
First
Second
Second I used before and it is nice as for me, but first one looks more promising.
Happy coding :)
Related
I have made my navigation drawer and it is working all fine , it is according to new design rules. but now I have a problem and after a couple of search I have found no note over it so far. So I end up with asking question here.
What I have done so far is some thing like
the picture shows you the demo , How ever I have made some thing like this its just the demo to give you people hint about what is header in the navigation drawer and where my menu items list lies
You can clearly see that there is a header in the navigation drawer and the menu item list beneath it .
Problem 1
now do to some reasons I have deleted the header , but my menu Items goes upwards to the top starting point. I know I can give margin up , but this is not the good way
Is there any good way I can just centralized them vertically ? I am wondering How to do it , Please Help me .
and Problem 2 is , I want to minimize the distance and margin between the menu items and menu icons in navigation drawer How to do this. I have not seen any of the discussion over it.
Please help me in solving both problems.
On screenshot you attached to your question, the navigation drawer doesn't look fine and according to the new desing rules :-/
Just have a look at the official guide: https://www.google.com/design/spec/patterns/navigation-drawer.html
Luckly for you nowdays we are provided by Google with Android Design Support Library that helps us with creating Navigation View (that replaces Navigation Drawer)
Here are links for you:
official documentation, always a good read: https://developer.android.com/reference/android/support/design/widget/NavigationView.html
nicely written blog post about Navigation View: http://antonioleiva.com/navigation-view/
and last but not least, sample app using new Android Design Library: https://github.com/antoniolg/MaterializeYourApp
I know it's not the answer you were looking for, like "just change true to false in the line number 10" but stay assured that using official Navigation View is a way to go in modern Android world.
You can use the new NavigationView from the Android Design Support Library in making your navigation drawer. NavigationView make s creating material design-compliant navigation drawer.
You can read about it at http://android-developers.blogspot.com/2015/05/android-design-support-library.html
Read these three articles
Take a look at this code
Use the design support library
Over the past few days I've started to work with the Master/Detail template in Eclipse and I've been trying to figure out a way to take the generated Master/Detail template and convert it to have a navigation drawer-type UI. I imagine that it's possible to do, but how can I go about doing? What do I need to add/remove/modify in order to get similar/identical functionality to a navigation drawer using Master/Detail? I'm asking for assistance creating it using Master/Detail because I have tried other methods with no luck whatsoever. Also, how can I customize the look of it (background color, text color, etc.)?
Thank you in advance for any help in solving this! I have searched relentlessly for a solution with no results unfortunately so I hope that someone in the SO community can assist.
Given that the Navigation Drawer is not appropriate for displaying Master/Detail data (i.e., it is only for navigation, not showing content), then you use the same steps as converting any Activity to using a Navigation Drawer. The Android training Creating a Navigation Drawer goes into extensive detail with all the code you'd need to add a Navigation Drawer to an Activity and properly implement the Navigation Drawer design pattern.
It may make sense to start with a simple Activity, then use what you learn there to apply it to the Master/Detail template.
I want to use sliding drawer from left to right ?
So can you tell me anybody how it is possible? and also use this drawer to all activity in my project.
Use the concept of viewpager.You can find doc and example below...
doc
Example
Check that library. API 6+ (even less, not quite sure)
https://github.com/6wunderkinder/android-sliding-layer-lib
You can attach a layer to any part of the screen with the addition that you can swipe the layout directly in and out, unlike the SlidingDrawer in which you just can drag from a small piece of UI (drawer).
You could also use the new NavigationDrawer pattern from Google.
http://developer.android.com/design/patterns/navigation-drawer.html
For example, please view this image from the Android Developers site.
Basically, I want to replicate this navigation drawer, currently I have it all except the sub items (Option 1, Option 2, in the example). There is no documentation on how to get this on the developers site. This is what I have currently:
MainActivity.java: http://pastebin.com/iNXW00ex
SeparatedListAdapter.java: http://pastebin.com/fESuvEVi
MainActivity.xml: http://pastebin.com/gg4JANwh
Drawer Item/Header.xml: http://pastebin.com/WzvPXQYm
That's all I think is needed. I'm aware that typically a expandable list view is used for the child items, though I'm unsure how to combine that with the current separated list adapter so I can still get titles.
Thanks, David.
There are a lot of third party libs for sliding menus.
Why not use one of them instead of trying to recreate Android's?
For example:
https://github.com/jfeinstein10/SlidingMenu
Have you checked out the Navigation Drawer tutorial in the Android docs?
http://developer.android.com/training/implementing-navigation/nav-drawer.html
Uses classes in the support library to make implementing the nav drawer pretty straightforward.
I'm trying to get a sliding drawer to pull down from the top in my application, but I can't figure out a way to do it. Any help?
The built in sliding drawer is not that flexible, your best bet is to extend it and modify its behavior, or take a look at this http://code.google.com/p/android-misc-widgets/
I had to do the same for one of my projects and I ended up writing my own widget for this. I called it SlidingTray is now part of my open source Aniqroid library. It allows sliding from all four corners and feel free to modify the code as your like.
http://aniqroid.sileria.com/doc/api/ (Look for download options to get it)
(Disclosure: I am the maintainer of the project.)
I have created a complete replacement for SlidingDrawer. It can slide from any direction and I find that it greatly outperforms the original. http://www.github.com/kedzie/DraggableDrawers