What is the difference between the SlidingMenu library and the Android Navigation Drawer? - android

The SlidingMenu library is an excellent third party library and I've already used it for a long time. Now I know Android provides a new navigation pattern using Navigation Drawer. It looks like the sliding menu. So is there anyone who already uses these two both? What is the difference and what are the pros and cons? Thanks a lot.

SlidingMenu library is a third party api which uses a RelativeLayout inside. The main advantage is customization according to your requirement. Buy your layouts have to be based on a viewgroup, unfortunatly this negates the <merge> optimisations.
Navigation Drawer is available in the Support Library of android it uses DrawerLayout inside. The main advantage is improved performance.

They also have different visual effects. SlidingMenu looks like horizontal scroll view. Sliding it in will push the main content out.
Pros :
It comes with cool entrance / exit animations for the menu content.
Depending on what Activity you use it on, it can be placed below the Action Bar or next to it (pushing the Action Bar too)
You can explicitly set the touch mode via a setter: margin or full screen. In full screen mode touching anywhere on the screen will open the menu. In margin, only when you slide from the edge of screen will the menu open.
Cons :
You can only control the shadow of the side menu
Navigation Drawer / Drawer Layout looks like an additional top level view in a frame layout. Sliding it in will mask the main content.
Pros :
If you use v4 support lib then it's already there.
You can control both the side menu shadow and obscure the main
content via setScrimColor e.g when the drawer is opened, a fade-in
alpha layer will appear above the main content. This is good to visually separate the content and the menu especially when both have a same color.
Cons:
It can only be placed below ActionBar
There is no setter for touch mode and by default you can only do margin touch mode. Doing a full screen touch mode (like Youtube) involves a lot of work

I think the best advantage is that It is official Google code, I mean it just works and works excellent.
The main disadvantage is that it is very basic to use, I mean... you cannot put two navigation drawer in the same activity or fragment, you can only use one in left and that's it.

You already said it yourself. Sliding menu is third party. Navigation drawer is official. Both have the same purpose, but third party libraries might implementing it slightly differently, depending on which one you use.

Related

How to get a Scrolling Activity With Navigation Drawer in Android (Material Design)

I've been interested in material design and wanted to build a layout for the main page of my app so that it looks like the default template for Scrolling Activity but also has a Navigation Drawer like the default template for Navigation Drawer Activity for easy navigation.
As an example, Google's Play Music app already does this sort of thing.
Have a look:
Scrolling list with a banner and a FAB at the top,
Navigation Drawer, accessed by swiping from over to the left
I've searched everywhere and could find a direct way for implementing such a layout. So I tried doing it on my own and with some changes here and there in the default templates of Scrolling Activity and the Navigation Drawer Activity I was able to achieve something along those lines but not exactly what I was looking for.
I was hopping if someone could present a better way of doing it.
You can still use the DrawerLayout supplied in the Android support library with a FrameLayout and ListView to achieve the Navigation drawer. In the FrameLayout, you will display a Fragment which takes a ScrollView to display scrollable content. The Fragment can also have other widgets that let you customize your layout.
I've got exactly what I wanted, you simply need to include Scrolling Activity's layout inside the layout of Navigation Drawer Activity and it works nicely.
You can use the default templates for these activities given in the Android Studio to save yourself some time or start from scratch.
Let me know if anyone needs some code and I will be more than happy to post it :)

Custom Navigation Drawer

as I pursue my study on android app development I came across this app from apple and I was wondering if, is there a way to imitate the navigation drawer in this screen shot?!
See it's an expandable navigation drawer. a list view with some items that are expandable. Is there an actual way to imitate this on android?
Thank you very much again for all of your help.
You can recreate that drawer.
You can use the ExpandableListView within the Navigation Drawer. And of course you'll have to create your own parent and child item layouts for the listview. As well as appropriate styling. You can use tutorials to do this, first create the navigation drawer, then create the expandablelistview and put it within the navaigation drawer layout.
I'd also like to note on that screen shot, the drawer is incorrect. It should slide out below the action bar, over-top of the activity (like in the link). It should not slide the entire application window to the right like how some apps do.
Use a Custom ListView for this, see here for that: How To Create A Custom Listview - Android Example
Also, you will have to create specialized buttons that have a different look than standard holo buttons, see here for that: How to create custom button in Android using XML Styles
Finally, I do not believe it is possible to directly clone the navigation drawer, as the app you showed doesn't have an open sourced app (as far as I know).

Implementing Navigation Drawer in android using different ways

I am working on an application, in which I need to implement navigation drawer. We have two different ways of implement navigation drawer in android as shown in attached screen shots :
In first way the sliding list is over main content. In second type, sliding list becomes visible and make main content to slide left to right with Navigation Drawer list.
I goggled a lot about this and only got solution of first type. I want to implement Navigation drawer like second type in attached screenshot. So please tell me what changes I need to make.
Thanks.
For the first case google's official Navigation Drawer is there.
And for the second case there's a third party library on github.
here's the link: https://github.com/jfeinstein10/SlidingMenu
Also I feel you've to use ActionBarSherlock (again a third party library) in order to implement the second case.
Moreover the google's drawer method is the recommended one as it supports a stable action bar, from where you can choose items even when the drawer is open. Also the design + app flow is slick and faster in this case as compared to the third party lib.

sliding drawer options android

I have a project where the designs require a sliding drawer that comes from the bottom and has essentially three states.
fully collapsed (just the handle at the bottom
half mast (drawer opens from bottom but only halfway up the screen
full mast (drawer opens from bottom and takes up the whole screen minus a top margin of lets say 80dp
I am developing for android 4.0 and higher and obviously sliding drawer is deprecated. But the Navigation drawer only supports left and right (which i already have in use)
So i am wondering if anyone knows a tutorial or even a custom component someone has written that meets the above functionality requirements
In my experience, you probably have to create something yourself, but since you're developing for api lvl 14, check out ObjectAnimator. It allows you to move Views around and still use them (by that I mean that it's the original view that has been moved and not a copy of it)
This will probably be the easiest way.
FYI, using the Navigation Drawer, you can't open the drawer halfway, or you should programmatically invoke touch events...
I think this is what you are looking for.
I have found this library best so far for sliding up menus in Android.
https://github.com/umano/AndroidSlidingUpPanel
You can specify what screen area slide up menu or view will use.
Accept & vote up my answer if it is what you are looking for.

Android how to make menu bar that appears at the side of the screen? Like Google Plus, Facebook menu on Android devices

I am developing an app on Android and would like to use the similar menu bar like Google Plus or Facebook, when you click the button, the menu bar will slide in and will not occupy the whole screen. Any ideas on that?
Thanks.
A pretty popular library for accomplishing the 'sliding menu' effect (or 'drawer' as the design guidelines on the Android developer website prefer to call it) is Jeremy Feinstein's SlidingMenu. It's also compatible with ActionBarSherlock, in case your project is using that too. Unfortunately, at this stage there is no component built into the SDK that allows you to do easily accomplish the same thing.
There are also a couple of alternative implementations for a sliding menu (do a search either here on SO or Google), but I haven't checked those out for a little while. If I recall correctly, there are especially some variations in terms of whether the ActionBar is supposed to slide along with the content or stay fixed at the top of the screen.
You can use FrameLayout in parent view and use translate animation in menu layout to show the slide in and slide out effect.

Categories

Resources