The new Facebook application and its navigation is so cool. I was just trying to see how it can be emulated in my application.
Anyone has a clue how it can be achieved?
On clicking the the top left button the page slide and the following screen is shown:
I've been playing with this the past few days and I've come up with a solution that's quite straightforward in the end, and which works pre-Honeycomb. My solution was to animate the View I want to slide (
FrameLayout
for me) and to listen for the end of the animation (at which point to offset the View's left/right position). I've pasted my solution here: How to animate a View's translationDid a roundup of an existing implementation and turned it into a library project plus example app. Also added XML parsing as well as autodetection of a possibly present actionbar, so it works with the native as well as a support action bar such as ActionBarSherlock.
This one also slides the action bar away!
The whole thing is a library project together with an example app and is described over at A sliding Menu for Android like google and facebook apps. Thanks to scirocco for the initial idea and code!
I think facebook app is not written in native code (by native code I mean, using layouts in Android) but they have used webview for it and have used some javascript ui libraries like sencha. It can be easily achieved using sencha framework.
Recently I have worked on my sliding menu implementation version. It uses popular J.Feinstein Android library SlidingMenu.
Please check the source code at GitHub:
https://github.com/baruckis/Android-SlidingMenuImplementation
Download app directly to the device to try:
https://play.google.com/store/apps/details?id=com.baruckis.SlidingMenuImplementation
Code should be self-explanatory because of comments. I hope it will be helpful! ;)
Here is the design and development guide found in official android documentation no need to add unofficial external library. Only android support library will do. Find the links here.
design and develop.
I didn't see the amazing SimonVT/android-menudrawer mentioned anywhere in the above answers. So here's a link
https://github.com/SimonVT/android-menudrawer
Its super easy to use and you can put it on left, right, top or bottom. Very well documented with sample code and Apache 2.0 license.