I use this library to implement slide menu in my app. It works that it push my activity content to left side. I want to Sliding Menu appear OVER my activity content. Is there any way to change appearing of this sliding menu?
Yes you can do it. Instead of that library you have to use Navigation Drawer.
For supporting from android 2.1 you have to use Support Library.
NavigationDrawer using only Android Support Library
https://developer.android.com/design/patterns/navigation-drawer.html
https://developer.android.com/training/implementing-navigation/nav-drawer.html
As you said, Jfeinstein Sliding Menu uses iOS style and push content to the left (with ActionBar)
The recommended way is using Android-styled component: Navigation Drawer. It appears over content and below ActionBar.
https://developer.android.com/training/implementing-navigation/nav-drawer.html
it's only your choise, but in my mind using android recommended way is prefer
Related
I have followed exact steps in the following tutorial for making navigation drawer using design support library. But i want to replace the default hamburger icon (using drawerToggle.syncState()). How can i do it?
https://github.com/codepath/android_guides/wiki/Fragment-Navigation-Drawer
Also I want to make Navigation drawer switch activities instead of fragments. For this, i have made a BaseActivity following above tutorial and extended all other activities from this BaseActivity. I am able to get the result but when a new activity is launched unable to preserve the highlighting of selected item in navigation drawer. Please suggest any solutions?
I use this library:
https://github.com/mikepenz/MaterialDrawer
I would like to have a right NavigationDrawer with a ListView (or a lot of items) inside and I get items from DB inside the Fragment and when user click on items on the NavigationDrawer I get data from another DB and show it on Fragment.
and I have a questions:
is possible to create a right Drawer inside a Fragment? or is better to create a new right Drawer in MainActivity and change the navigation item inside the Fragment?
Just use brand new Navigation View from recenlty released Android Design Support Library by Google.
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
To have Navigation View on the right, just set android:layout_gravity to end.
As from design point of view, you should always use left sided Navigation Drawer, it is possible to make it right sided, but its recommended to leave it at the left side.
Another thing is that you do not need to use 3rd party navigation drawer libraries.Since there is a Design library by google, which supports the material design navigation view.
Here is a link for the library:
https://developer.android.com/tools/support-library/features.html
And here is another useful link:
https://guides.codepath.com/android/Design-Support-Library
Here is the link for the Navigation Drawer: https://guides.codepath.com/android/Fragment-Navigation-Drawer
As for your question the appropriate way is to create the drawer always in the main activity onCreate() method.
I would like to create my own Navigation Drawer
using the current Material Design for the Navigation Drawer.
A good example of this implementation is the YouTube app.
In the App the Navigation Drawer overlaps the Action bar and is not below the action bar like in previous implementations.
I've tried following some example from other people's tutorials but they fall short of what I want. I have included some of the implementations that I have tried. I do not want to use a Library,
I want to implement it . Is there currently a tutorial that applies the Material Design Patterns properly.
YouTube Navigation Drawer
http://www.google.com/design/spec/patterns/navigation-drawer.html#
I used https://github.com/chrisbanes/cheesesquare as a reference. However I came across this tutorial that provides a proper guide on how to create a material design navigation drawer whilist also handling the click events of menu items
https://guides.codepath.com/android/Fragment-Navigation-Drawer
I'm trying to get a NavigationDrawer working with sliding tabs inside a fragment (just like google play music or the google i/o app). In all my reasearch I found that you can't use Action bar tabs + Navigation Drawer together because the Navigation drawer will look like in the back of the tabs (I notice that). Can anyone help me telling me how to get that done without use an external library such ActionBarSherlock or TabHost (according to the documentation is recommended the use of actionbar)?
Yes, you're right. It won't be possible using ActionBar tabs as the navigation drawer won't overlap them. I recently implemented a library called ViewPagerAddons which has a custom view called SlidingTabLayoutColors imitating the behavior seen in Google Play/Music.
But as you said you don't want to use any libraries, you can still have a look at the source code. Here's the link with instructions: https://bitbucket.org/enthusiast94/viewpageraddons
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.