B4A Library MSMaterialDialogs

Discussion in 'Additional libraries, classes and official updates' started by thedesolatesoul, Mar 29, 2015.

  1. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Looking to theme your app to Material Design? Or even ensure Holo?
    This library will make your dialogs look either Material or Holo on every Android version.
    This is a port of THIS repo

    One thing to note these are NOT modal dialogs. Code execution will continue in the background.

    It is very easy to use.

    Screenshots
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    Example
    Quick Alert Dialog:
    Code:
    Sub btn3_Click
        
    Dim MB As MSQuickDialogs 
        MB.ShowMaterialDarkMessageBox(
    "Title","QuickDialog2","QD2")
    End Sub

    Sub QD2_DialogResponse(Response As Int)
        
    Msgbox("QD2","Old Messagebox!")
    End Sub
    Showing a listdialog:
    Code:
    Dim itemList As List = Array As String("Organes""Nabanabas""Appels""Drapes""BawSterries""Lemlons")
        
    Dim builder As MSDialogBuilder 
        builder.Initialize(
    "MyDialog")
        builder.setTitle(
    "Material List Dialog").setMessage("This is a List dialog").setThemeColor(Colors.Green)
        builder.setButton(
    DialogResponse.POSITIVE , "OK")
        builder.setCancelable(
    True)
        builder.setDesign(builder.DESIGN_MATERIAL_DARK)
        builder.setListStyle(itemList)
        builder.show
    Usage
    Copy the res files to a location on your HDD, and in your project you need to use #AddtionalRes to point to these files.

    Limitations
    Currently cannot do custom dialogs. Might work on that later if worthwhile.


    Download
    Demo APK
    Library+Sample+Res
     
  2. migrec

    migrec Member Licensed User

    I don't know if a million thanks is enough for your work here, but I'll give you one more, thank you.
     
    thedesolatesoul likes this.
  3. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I figured out a way to do custom dialogs. Still figuring out how to use it with AppCompat not quite there yet.
    [​IMG]
     
    migrec, shashkiranr and NJDude like this.
  4. shashkiranr

    shashkiranr Active Member Licensed User

    Hi thedesolatesoul,

    Any progress on the custom dialogs?

    Regards,
    SK
     
  5. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Sorry not yet. I'm focusing on other libraries (with whatever spare time i have).
     
    lemonisdead, NJDude and Peter Simpson like this.
  6. shashkiranr

    shashkiranr Active Member Licensed User

    No prob :) thank you for your efforts :)
     
  7. Peter Simpson

    Peter Simpson Expert Licensed User

    Very nice, I'll use this in my big project.

    Cheers...
     
  8. shashkiranr

    shashkiranr Active Member Licensed User

    Getting this error. I do not have the ripple view library added to my libraries folder. :(

    Code:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/andexert/library/
    RippleView$1;
        at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:
    122)
        at com.android.dx.dex.file.DexFile.add(DexFile.java:
    161)
        at com.android.dx.command.dexer.Main.processClass(Main.java:
    732)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
    673)
        at com.android.dx.command.dexer.Main.access$
    300(Main.java:82)
        at com.android.dx.command.dexer.Main$
    1.processFileBytes(Main.java:602)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:
    284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:
    166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:
    144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:
    632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:
    279)
        at com.android.dx.command.dexer.Main.run(Main.java:
    245)
        at com.android.dx.command.dexer.Main.main(Main.java:
    214)
        at com.android.dx.command.Main.main(Main.java:
    106)
    1 error; aborting
        Optimized dexer failed. Switching 
    to Standard dexer.
    Regards,
    SK
     
  9. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Yes, rippleview is part of both MSMaterialDialogs and MSMaterialMenu. (to be honest there is no need to use MSMaterialMenu after AppCompat). I need to refactor these libraries for proper division. Probably MSMaterialMenu will disappear.
     
    NJDude likes this.
  10. shashkiranr

    shashkiranr Active Member Licensed User

    But currently I am using MSMaterialMenu along with AHNavigationDrawer and it works superbly... ! So you are saying there is a way to get the same MSMaterialMenu animation by using only AppCompat ??
     
  11. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Which version of MSMaterialMenu are you using?
    The one in this post: http://www.b4x.com/android/forum/threads/msmaterialmenu-animating-icons.44735/
    or the one in this post: http://www.b4x.com/android/forum/threads/msmaterialmenu-animating-icons.44735/page-2#post-291365
    The first one is BARE MSMaterialMenu so it will solve your problem.
    The second one includes other stuff (and will be deleted).
    It is possible to get the menu animations with AppCompat, but currently the only way to access them AFAIK is: http://www.b4x.com/android/forum/th...-build-navigation-drawers-fast.52972/#content
     
    shashkiranr likes this.
  12. shashkiranr

    shashkiranr Active Member Licensed User

    Thank you for your reply. I was thinking where i was going wrong. I added back the first one back and i got this error. I will wait for the final library until then i will use the normal dialogs.

    Code:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/balysv/materialmenu/MaterialMenu;
        at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:
    122)
        at com.android.dx.dex.file.DexFile.add(DexFile.java:
    161)
        at com.android.dx.command.dexer.Main.processClass(Main.java:
    732)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
    673)
        at com.android.dx.command.dexer.Main.access$
    300(Main.java:82)
        at com.android.dx.command.dexer.Main$
    1.processFileBytes(Main.java:602)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:
    284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:
    166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:
    144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:
    632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:
    279)
        at com.android.dx.command.dexer.Main.run(Main.java:
    245)
        at com.android.dx.command.dexer.Main.main(Main.java:
    214)
        at com.android.dx.command.Main.main(Main.java:
    106)
    1 error; aborting
        Optimized dexer failed. Switching 
    to Standard dexer.
    Regards,
    SK
     
  13. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Ok, my apologies. You dont need MSMaterialMenu at all. It is already included in MSMaterialDialogs.
    I really need to get my stuff together on packaging these libs.
     
  14. shashkiranr

    shashkiranr Active Member Licensed User

    Take your time :) and thank you for all the support u r giving to the forum. :)
     
  15. ArminKH

    ArminKH Well-Known Member

    thank u
    have we a chance for custom themes?(for non-english language)
     
  16. ™AsAs4242

    ™AsAs4242 Member Licensed User

    i have a problem and crash after tick rippleview lib and untick ...

    Code:
    android.view.InflateException: Binary XML File line #3: Error inflating class com.andexert.library.RippleView

    But There fc problem first in Android 2.3.4
     
  17. mshafiee110

    mshafiee110 Member Licensed User

    hi @thedesolatesoul
    I use from MSmaterialdrawer and MSMaterialDialogs together.

    but Error occurs.
    pls help me.tnx
     
  18. susu

    susu Well-Known Member Licensed User

    Hi @thedesolatesoul , which is min Android version your MSMaterialDialogs can work on? Thanks!
     
  19. Scantech

    Scantech Well-Known Member Licensed User

    Nice library. Can you add icons option in list dialog?
     
  20. Anser

    Anser Well-Known Member Licensed User

    Hi thedesolatesoul,

    Any progress on the custom dialogs along with AppCompat ?

    Regards,
    Anser
     
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