What is the difference between the SlidingMenu library and the Android Navigation Drawer?
Asked Answered
C

4

18

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.

Calcareous answered 29/5, 2013 at 10:0 Comment(0)
H
10

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.

Hairstreak answered 29/5, 2013 at 10:14 Comment(3)
Navigation Drawer is the best way to go now since google is making it as a standard and provides lots of support for this .Hairstreak
SlidingMenu library have awesome samples with Responsive UI, I'm searching for the same in Navigation Drawer! I'm planning to port samples of SlidingMenu to Navigation Drawer :)Whisker
@TCA It seems though that there is no way to make it close smoothly without introducing artificial delay.Kkt
C
4

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
Christianechristiania answered 5/11, 2013 at 16:32 Comment(0)
C
1

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.

Cowles answered 29/5, 2013 at 14:15 Comment(3)
The navigation drawer can be use on the left side or right side and even on both sides at the same time with different views. I already use it that way. here is a blog post with more info: onsoftwareandstuff.com/2013/06/19/…Shaunna
navigation drawer really need some samples like SlidingMenu have! We can start porting it to navigation drawer!!Whisker
can i use activity instead of fragments?i meants i want to go to activity class when i click on item.i searched many examples but in most examples are using fragments instead of activityAge
F
0

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.

Fistulous answered 29/5, 2013 at 10:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.