B4A Library MSMaterialMenu - Animating icons

This library simulates some animations on the drawer icon on the titlebar that are coming in on the material design.
It comes from this library: https://github.com/balysv/material-menu

68747470733a2f2f7261772e6769746875622e636f6d2f62616c7973762f6d6174657269616c2d6d656e752f6d61737465722f6172742f64656d6f2e676966


Dependencies:
- The NineOldAndroid java package, is included in the zip file.

Credits:
Thanks to Informatix for his NineOldAndroids library and for modifying it for me.

Sample:
B4X:
    Dim StdABHelper As StdActionBarHelper
    Dim MMenu As MSMaterialMenu
    StdABHelper.Initialize
    MMenu.Initialize("MMenu")

    MMenu.setScaleAndStroke(1,2)
    MMenu.Color = Colors.Black
    StdABHelper.Icon = MMenu.Drawable


Sub StdAB_ButtonClicked
    If MMenu.State = "BURGER" Then
        MMenu.animatePressedState("X")
        NavDrawer.OpenDrawer
    Else
        MMenu.animatePressedState("BURGER")
        NavDrawer.CloseDrawer
    End If
End Sub

This will work best with StdActionBar+StdActionBarHelper (wish they were merged).
 

Attachments

  • MSMaterialMenu.zip
    119.5 KB · Views: 2,528
Last edited:

migrec

Member
Licensed User
Longtime User
using this with the sliding menu class and it works really fine! will you make some more material libraries when you have time?
 

thedesolatesoul

Expert
Licensed User
Longtime User
I will, I have a couple on my ToDo list but getting no time at all.
Do you have a demo of it with the sliding menu class?
I used it with the AHNavigationDrawer library but I was not satisified with the results. (Drawer was jerky and transparent, also need a way to animate the icon AS the drawer moves)
 

migrec

Member
Licensed User
Longtime User
It works fine with SlideMenu class and it's highly customizable, but it's also simpler like you can't change the item click color. I can post it soon, just need to clean a bit first.
 

thedesolatesoul

Expert
Licensed User
Longtime User
The reason I wanted to go with a native google drawer was because it would look consistent on newer versions on Android. (For e.g. in 'L' the drawer slides OVER the actionbar, we dont have any library that does that). Maybe if I look at your demo it will make me go for the class.
Sometimes google gives me headaches with their constant changes, U-turns and inconsistency.
 

migrec

Member
Licensed User
Longtime User
Here is an easier alternative to Navigation Drawer, it uses the SlideMenu class.

It should look like the screenshot, just ask if something looks weird.
 

Attachments

  • SLIDE MATERIAL.zip
    68 KB · Views: 1,142
  • Screenshot_2014-10-06-21-43-57[1].png
    Screenshot_2014-10-06-21-43-57[1].png
    16.2 KB · Views: 1,791

thedesolatesoul

Expert
Licensed User
Longtime User
Here is an easier alternative to Navigation Drawer, it uses the SlideMenu class.

It should look like the screenshot, just ask if something looks weird.
Very nice, very clean!!
My only gripe with this class is that it doesnt have a gesture to pull the drawer open but that should be easy to add with GestureDetector.
Also, I can see you have done a lot of work on the xml theme, very impressive! I was also doing the same at one point.
 

thedesolatesoul

Expert
Licensed User
Longtime User
This is excellent - thank you. Don't suppose you have any plans on material style buttons do you?
Yes I do want to. I was hoping the compatiblity library will have some kind of theme/style we could overlay on the buttons. I didnt want to port a library specifically for this. Still not sure how to acheive it.
 
Top