B4A Library MSMaterialMenu - Animating icons

Discussion in 'Additional libraries, classes and official updates' started by thedesolatesoul, Sep 15, 2014.

  1. thedesolatesoul

    thedesolatesoul Expert Licensed User

    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

    [​IMG]

    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:
    Code:
    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).
     

    Attached Files:

    Last edited: Mar 23, 2015
  2. sf0799

    sf0799 Member Licensed User

    Thank you very much, expect your example
     
  3. Alberto Iglesias

    Alberto Iglesias Well-Known Member Licensed User

    Me too! Waiting for one sample
     
  4. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I was hoping to write a bigger/better material sample but i got stuck with my NavDrawer transparent and havent had time to do it ever since :(
     
  5. migrec

    migrec Member Licensed User

    using this with the sliding menu class and it works really fine! will you make some more material libraries when you have time?
     
  6. thedesolatesoul

    thedesolatesoul Expert Licensed 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 likes this.
  7. migrec

    migrec Member Licensed 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.
     
  8. thedesolatesoul

    thedesolatesoul Expert Licensed 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.
     
  9. Douglas Farias

    Douglas Farias Expert Licensed User

    Android version?
     
  10. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I think it is 2.1+
     
    Douglas Farias likes this.
  11. Douglas Farias

    Douglas Farias Expert Licensed User

    thx man nice work
     
  12. migrec

    migrec Member Licensed 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.
     

    Attached Files:

  13. thedesolatesoul

    thedesolatesoul Expert Licensed User

    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.
     
  14. gadgetmonster

    gadgetmonster Active Member Licensed User

    This is excellent - thank you. Don't suppose you have any plans on material style buttons do you?
     
  15. thedesolatesoul

    thedesolatesoul Expert Licensed User

    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.
     
  16. gadgetmonster

    gadgetmonster Active Member Licensed User

    Another good one to have would be Material Design style dialog boxes :)
     
  17. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I have already! Just havent gotten time enough to create a sample, package, document and post it.
     
    gadgetmonster likes this.
  18. gadgetmonster

    gadgetmonster Active Member Licensed User

    You are da man!!!! Is there any where to make a donation towards this effort?
     
  19. thedesolatesoul

    thedesolatesoul Expert Licensed User

    There will be after I upload the libraries.
    Also, thinking of doing a switch library. I dont like the android 5 switch.
     
    NJDude likes this.
  20. gadgetmonster

    gadgetmonster Active Member Licensed User

    Sounds good to me :) will the dialogs allow for custom views to be added?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice