I would like to create an Android application that uses the same ActionBar folder affordances that the new GMail application employs (the Three horizontal lines to the right of the GMail M).
and when pressed a folder menu list slides out from the right side of the screen
i have tried searching the google docs but have failed to find what i am looking for.
I had guess it was a slidingDrawer widget, however that has been deprecated in API 17.
It's called a DrawerLayout and is part of the official support library. The Android training section provides a good tutorial on it here. Here you can find an in-depth design documentation of how you should use it and how its navigation should work.
The three lines to the LEFT of the icon slide out the new Navigation Drawer pattern which was introduced by google at this years Google I/O.
http://developer.android.com/training/implementing-navigation/nav-drawer.html
Related
I want to setup a 'tabbed' application. Looking through all the tutorials including the google docs here:
http://developer.android.com/training/implementing-navigation/lateral.html
However as I start to go through the docs I get all kinds of deprecated warnings:
actionBar.setSelectedNavigationItem(position);
I would really like to start off right and use any new non deprecated methods. Most examples of tab applications are years old. What am I missing? Am I searching for the wrong thing? Can someone point me in the right direction for developing a tabbed application.
What am I missing?
Action bar tabs were deprecated in Android 5.0, last fall.
Can someone point me in the right direction for developing a tabbed application.
Use TabLayout, though this is a very new addition to the Android Support libraries.
Or, use ViewPager with your favorite tabbed indicator, of which there are many.
Or, use FragmentTabHost.
How can I implement a Sliding Tabs like in the new Google Play Store 5.0?
click for the image
I have seen so much examples, but all using a "addTab" that is deprecated or not run on android 2.x.
I need a example about this implementation.
My Idea is that in my APP the tabs will be created in according with the information that come of my Web Service. So my APP can have 3 tabs or 40 tabs.
Here is an barebones example in the documentation: http://developer.android.com/training/implementing-navigation/lateral.html#PagerTitleStrip
Also, here is the PagerTitleStrip documentation.
I would like to implement a drawer in my app, like in the hangouts app, just on the left side, but thats not the most importent, its good on the right too.
I already implemented a menu drawer, how can i make it semi closed like the picture on the link?
Or is this a new kind of drawer? Then whats its name? So i can search for some samples.
http://i.stack.imgur.com/MxdbO.png
I used support.v4 library, and the actionbarsherlock. So this project is api >=10.
Thank you for your help.
It's called SlidingPaneLayout. In this week's episode of Android Design in Action, Roman Nurik also mentioned that it is used by the Hangouts app.
Watch this part of the Google I/O Session Android Design for UI Developers to see how to implement this pattern.
Not quite sure what you mean about SlidingDrawer to the left, but I'll guess that you refer to the SlidingMenu, am I correct? In that case, I've used this library successfully:
https://github.com/jfeinstein10/SlidingMenu
This library is also compatible with the ActionbarSherlock.
How can I add one of those sidebar buttons to the actionbar like in the new google apps? I cannot find any information on it on the internet. I only found info on how to add buttons to the right of the application logo which is not what i need.
The official Google implementation is available through the latest Support Library. Here is a link to more information about how to set it up.
Does anyone know how to implement a sliding menu like some of the top apps of today?
Other Stack Overflow questions haven't had any answers on how to do this, so I'm trying to gather as much info to help out others. All the applications I mention below do a great job of implementing the slide menu.
1. Google Plus (as of 7/7/12)
You can only go from the first screen to the second screen by clicking the G+ logo in the upper left hand corner. Notice that the entire screen moves from it's position and get's nudged to the right side of the screen (including the action bar). To get back to the first screen you can either slide the right side back into focus or you can click the G+ icon again.
2. YouTube (as of 7/7/12)
You can go from the first screen to second screen using two methods. Either click the YouTube logo in the upper left, or you can use a swipe gesture to move it to the right. This is already different from the G+ app. Secondly, you can see that the action bar stays put (Unlike G+). Lastly, to get the original screen back it works just like G+.
Edit #3:
The Navigation Drawer pattern is officially described in the Android documentation!
Check out the following links:
Design docs can be found here.
Developer docs can be found here.
Edit #2:
Roman Nurik (an Android design engineer at Google) has confirmed that the recommended behavior is to not move the Action Bar when opening the drawer (like the YouTube app). See this Google+ post.
Edit #1:
I answered this question a while ago, but I'm back to re-emphasize that Prixing has the best fly-out menu out there... by far. It's absolutely beautiful, perfectly smooth, and it puts Facebook, Google+, and YouTube to shame. EverNote is pretty good too... but still not as perfect as Prixing. Check out this series of posts on how the flyout menu was implemented (from none other than the head developer at Prixing himself!).
Original Answer:
Adam Powell and Richard Fulcher talk about this at 49:47 - 52:50 in the Google I/O talk titled "Navigation in Android".
To summarize their answer, as of the date of this posting the slide out navigation menu is not officially part of the Android application design standard. As you have probably discovered, there's currently no native support for this feature, but there was talk about making this an addition to an upcoming revision of the support package.
With regards to the YouTube and G+ apps, it does seem odd that they behave differently. My best guess is that the reason the YouTube app fixes the position of the action bar is,
One of the most important navigational options for users using the YouTube app is search, which is performed in the SearchView in the action bar. It would make sense to make the action bar static in this regard, since it would allow the user to always have the option to search for new videos.
The G+ app uses a ViewPager to display its content, so making the pull out menu specific to the layout content (i.e. everything under the action bar) wouldn't make much sense. Swiping is supposed to provide a means of navigating between pages, not a means of global navigation. This might be why they decided to do it differently in the G+ app than they did in the YouTube app.
On another note, check out the Google Play app for another version of the "pull out menu" (when you are at the left most page, swipe left and a pull out, "half-page" menu will appear).
You're right in that this isn't very consistent behavior, but it doesn't seem like there is a 100% consensus within the Android team on how this behavior should be implemented yet. I wouldn't be surprised if in the future the apps are updated so that the navigation in both apps are identical (they seemed very keen on making navigation consistent across all Google-made apps in the talk).
Just recently I forked a current Github project called "RibbonMenu" and edited it to fit my needs:
https://github.com/jaredsburrows/RibbonMenu
What's the Purpose
Ease of Access: Allow easy access to a menu that slides in and out
Ease of Implementation: Update the same screen using minimal amount of code
Independency: Does not require support libraries such as ActionBarSherlock
Customization: Easy to change colors and menus
What's New
Changed the sliding animation to match Facebook and Google+ apps
Added standard ActionBar (you can chose to use ActionBarSherlock)
Used menuitem to open the Menu
Added ability to update ListView on main Activity
Added 2 ListViews to the Menu, similiar to Facebook and Google+ apps
Added a AutoCompleteTextView and a Button as well to show examples of implemenation
Added method to allow users to hit the 'back button' to hide the menu when it is open
Allows users to interact with background(main ListView) and the menu at the same time unlike the Facebook and Google+ apps!
ActionBar with Menu out
ActionBar with Menu out and search selected
There is a great implementation of NavigationDrawer that follows the Google Material Design Guidelines (and compatible down to API 10) - The MaterialDrawer library (link to GitHub). As of time of writing, May 2017, it's actively supported.
It's available in Maven Central repo.
Gradle dependency setup:
compile 'com.mikepenz:materialdrawer:5.9.1'
Maven dependency setup:
<dependency>
<groupId>com.mikepenz</groupId>
<artifactId>materialdrawer</artifactId>
<version>5.9.1</version>
</dependency>
I know this is an old question but the most up to date answer is to use the Android Support Design library that will make your life easy.
Personally I like the navigationDrawer in Google Drive official app. It just works and works great. I agree that the navigation drawer shouldn't move the action bar because is the key point to open and close the navigation drawer.
If you are still trying to get that behavior I recently create a project Called SherlockNavigationDrawer and as you may expect is the implementation of the Navigation Drawer with ActionBarSherlock and works for pre Honeycomb devices. Check it:
SherlockNavigationDrawer github