Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android side navigation menu : how to include the actionbar in the slided view?

I want to add a side navigation menu to my android app (like Facebook, Google+, Spotify, Prixing, Evernote, etc)

I already had a look here : Android Facebook style slide and here : https://github.com/Gregadeaux/android-fly-in-app-navigation

By following this last link, I got a working implementation which I customized a bit.

As you can see the action bar doesn't slide. That's normal since it's not a part of the sliding view in the Gregadeaux's implementation.

I'd like to include the actionbar in the sliding view. It's probably possible by making a custom implementation of the actionbar but I'd like to keep the original one.

The Google+ app seems not to use a custom actionbar.

Any idea how I can do that? Thanks :)

EDIT: After some search I eventually found that the Google+ app is using a custom actionbar implementation.

like image 575
Alexis Avatar asked Nov 08 '12 07:11

Alexis


People also ask

Where is ActionBar in Android?

In Android applications, ActionBar is the element present at the top of the activity screen. It is a salient feature of a mobile application that has a consistent presence over all its activities.

How do you add action items to the action bar?

All action buttons and other items available in the action overflow are defined in an XML menu resource. To add actions to the action bar, create a new XML file in your project's res/menu/ directory. The app:showAsAction attribute specifies whether the action should be shown as a button on the app bar.

How do I add an icon to the Android toolbar?

Now if you want to add other resolutions pictures to this drawable, just do it in the same manner. Step 5) And now go to the other folder which is Settings -> Androids-> drawable hdpi. And then go to your Android, then drawable, paste it here and inside this drawable-hdpi and click Ok.


1 Answers

I found a even better solution! super easy to use, super flexible.

https://github.com/jfeinstein10/SlidingMenu

EDIT:

Note that the new navigation drawer should now be used in order to comply to the android design guidelines. Check http://developer.android.com/design/patterns/navigation-drawer.html

like image 147
Alexis Avatar answered Sep 19 '22 00:09

Alexis