I'm using menudrawer library in my project (this one: https://github.com/SimonVT/android-menudrawer).
I'm updating my app to be compatible with API21 (Android 5 Lollipop) and Material Design. When you use this library with API21 menudrawer icon looks bad.
I want to achieve transition you can see in the new Play Store (new menudrawer icon transition to arrow).
What's the best way to do that? Is it possible with this library? The only solution I'm thinking at the moment is custom drawable. But maybe I can use native drawable some way?
Check out the new lollipop components released in May 2015 by Android team.
Design Support Library
Blog on Design Support Library
OK. I spent few hours with new API and I think that the best for me will be rewriting my drawer from lib to native DrawerLayout.
But maybe this will be useful for someone with similar problem. I've created test project with DrawerLayout (Android Studio -> New Project with menudrawer).
And then I saw the same problem. Wrong icon. If you want to see fancy animation and good icon for Android 5.0 make sure you are using:
Take note on v7. By default Fragment class has v4 import and then you won't see good icon.
Another thing. After changing to v7 you need to fix ActionBarDrawerToggle function to new constructor. And that's it. You'll see new drawer icon.
First, make sure you update to latest SDK. Create new Project in Android Studio, then add appcompat-v7.21.0.+ and appcompat-v4.21.0.+ libraries in your buid.gradle as gradle dependency.
Add primaryColor and primarycolorDark in your color.xml file.
Add drawer open/close string value in your strings.xml file.
Your activity_my.xml layout file looks like this:
Your toolbar.xml layout file looks like this:
Your MyActivity.java looks like this: Here your activity must extends ActionBarActivity and set your toolbar as support actionbar.
Create style.xml file in values-21 folder for android lollipop
Create your style.xml file in values folder for older versions then android lollipop
Your AndroidManifest.xml is looks like this:
For reference only: you can download complete source code from here : click here