I use sliding drawer menu in my android project and
I use one drawer menu for all of myActivies
I want in root Activity when click on actionbar`s icon the drawer menu is open!
and in childs Activities when click on actionbar's icon go to parent Activity
like google play or gmail and ...
how I can do this?!
Implement the navigation as usual (with drawertoggle and everything), then call
_toggle.setDrawerIndicatorEnabled(false);
It will hide the drawer icon (the three vertical lines) and display the up caret. The up icon click event will not be handle by the drawer and will finish the activity (if you do so in the OnOptionsItemSelected).
yup, you can use Navigation drawer in the layout and as well as in the java code.
check this url for screenshot
https://developer.android.com/design/media/navigation_drawer_holo_dark_light.png
Related
i want to design a navigation drawer for my app . In it i want various options to go to various activity.
I also want to add some clickable items on title bar which would go to any activity specified.
so, please suggest me direction to proceed.
Best example is add new activity and select "Navigation Drawer Activity"
That use titlebar item for opening menu and swip for opening and closing menu
I created a navigation drawer but I don't want to use the ActionBar with the hamburger button, I would like to be able to open the navigation drawer with a swiping gesture from the left to the right in every activity.
I also don't understand very well the use of Fragments.
By the way, to create my Navigation drawer I used this youtube video: Video
Thanks.
You can achieve this by hiding the hamburger button. Set your toolbar navigation icon to null.
toolbar.setNavigationIcon(null);
i am developing an chat app in that there are two navigation drawer
Left side drawer has hamburger icon to open and close
i want to place an icon in the right side of the screen so that when the user touches icon the navigation drawer will open like in android emulator there is small icon extending to the navigation drawer
Use menu items like below:
<item
android:id="#+id/workteamaction"
android:icon="#drawable/yourimage"
android:title="#string/yourtitle"
app:showAsAction="always" />
And set your image.then, handle it for showing that NavigationDrawer.
Also, take a look:
Two Navigation Drawer on same Activity
Handling a Menu Item Click Event - Android
Also, i've saw one application was using OveflowMenu for opening another NavigationDrawer.you may want to take a look at here :
Android create custom overflow menu item
Edit:
i want to place an icon in the right side of the screen so that when
the user touches icon the navigation drawer will open like in android
emulator there is small icon extending to the navigation drawer
Use android:gravity="" for your porpuse and then handle it for showing that NavigationDrawer.
E.g: android:gravity="end"
Read the docs for the flags.(right-left-center-buttom or etc).
I'm using MaterialDrawer library to implement a basic material drawer in my app.
I wasted more than two days trying to figure out how to transform the menu toggle button (burger) to a back button, like Gmail app when you open an email.
In Gmail app when you open an email the menu icon is animated into a back arrow but the menu drawer remains still available.
I've tried to use ValueAnimator to animate the icon as explained here.
I've setted an onAnimationEnd listener to replace the menu icon with a working back button:
result.getActionBarDrawerToggle().setDrawerIndicatorEnabled(false);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
After doing that the menu drawer slide position get unlinked from the menu drawer icon animation, and when i try to restore the menu drawer button and animate it backwards it gets stuck:
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
result.getActionBarDrawerToggle().setDrawerIndicatorEnabled(true);
Actually a similar question has been already asked, and has been marked has duplicated when it is not: Navigation Drawer with Burger to back arrow animation on Lollipop
I have an Activity that its root element is a DrawerLayout, the DrawerLayout has a ListView child that acts as the left view of the drawer layout.
The question is:
How can I force the left drawer's list view to not close completely ?
I want its closed state to be like the photo below
I am currently using Android's guide to Create a Navigation Drawer.
I am open for any other library - like Sliding Menu - if that accomplishes my goal.
Thanks in Advance.
You can use SlidingPaneLayout, it's similar to NavigationDrawer.
Check this tutorial to find out how to reach it.
Why not just use that far leftmost menu as a fragment within your activity. Upon opening the NAv Drawer, you can still have it show the menus that are 2nd or 3rd level. This is pretty standard for our app, with a menu exposed and further menus available upon opening the drawer