I have an app in which I would like a slide out menu. It would not be in control of all the apps settings, just a simple menu with a few options. I will still have a settings menu so I don't want to get rid of that. I would like to activate the slide menu with an icon in one of the corners of the app. On the button click I would like to slide out this simple menu (not settings).
Should I use the Navigation Drawer? My first thought is no since I am not controlling any sort of navigation from within this slider. Navigation Drawer also has some default behaviors that I am not sure you can override, i.e. slide from left side of screen to access, click app icon to access, click settings menu to access.
Am I supposed to use a Navigation Drawer and try and override a bunch of behavior or is there another android pattern that I can use?
Related
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've setup up a navigation drawer in my android App. I would like to add a button to the left but not in the action bar, because I don't have action bar. What I want to do is a button which can be taken and swiped to open the menu.
In the doc : http://developer.android.com/training/implementing-navigation/nav-drawer.html#ActionBarIcon I don't want to use the app icon, but my own button.
Is it possible ?
With this library you can do exactly what you want. It's easy to implement and use.
https://github.com/jfeinstein10/SlidingMenu
Currently i am developing an app that needs to have a sliding menu but inside that sliding-menu i want to have a preference activity style like , for example like YouTube app sliding menu style.
I am working with "jfeinstein" sliding menu because i didn't found something else to make the sliding menu and it's not offering a way to make a activity in the sliding menu.
So is there another sliding menu library or is there actually a way to do what i described?
Thanks
I have implemented a sliding menu navigation in my app like in this picture.
When the user clicks an item in the sliding menu, a Fragment is created for the corresponding menu entry and it replaces any existing fragment. When the used navigates further away, for example, the top level Fragment is a ThingListFragment for a list of thigs, and he taps one to open a ThingDetailFragment, then I want to replace the sliding menu icon with an icon of a back arrow (so the user must first go back to the top level either by this button or by hardware back button before being able to access the menu).
At this moment I'm setting this manually and it's time consuming and error-prone if I have a lot of fragments like this.
Is there some clever way to achieve this?
Try to make a basic fragment class (for exaple: FragmentBasic) where you register your action bar icons, and then every fragment who needs these icons, extends your FragmentBasic class. after this just implement the extra layout you want
So I'm working on adding ActionBarSherlock and the Navigation Drawer to a project that previously implemented a custom (very poorly written) "action bar". Instead of using fragments and a backstack of activities for navigation, some activities show and hide different layouts. (That is, suppose I am in a list mode and then select a button to go into an edit screen. The app currently hides the list layout and shows another layout.).
So I've added actionbar sherlock and a navigation drawer to all the activities. I want to be able to programmatically switch the navigation icon from the 3 lines to the arrow when certain buttons are pressed.
I can't figure out how to do this though. Any ideas?
Thanks!
The solution to this problem is to use the method:
setDrawerIndicatorEnabled(boolean enable)
inside the ActionBarDrawerToggle class.
After:
drawer.setDrawerListener(toggle);
Use this code:
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.select);
It depends how wedded you are to built-in actionbar artifacts. You can always redraw the current actionbar by inflating a layout of your choosing, then calling
getSherlockActivity().getSupportActionBar().setDisplayShowTitleEnabled(false);
getSherlockActivity().getSupportActionBar().setDisplayShowHomeEnabled(false);
getSherlockActivity().getSupportActionBar().setDisplayShowCustomEnabled(true);
// Inflate and do whatever you need to your view...
getSherlockActivity().getSupportActionBar().setCustomView(abView);
getSherlockActivity().getSupportActionBar().show();
When you want to go back to your standard (assuming you're using a DrawerLayout to do your navigation drawer), you can just set make a call to setDisplayShowCustomEnabled(false) (re-enable showHome and showTitle as you please).
As far as I know, customization of the back button can only be done via themes. Besides, swapping the drawer icon for the back icon (within the same Activity) doesn't make sense, since users would still be able to access the navigation drawer by sliding the left most edge to the right. It just wouldn't make sense.
If you absolutely need the back icon, then it would make the most sense to make that screen a new Activity since you would indeed be adding another "level" to the stack, which is what the back icon represents.