B4A Library MSMaterialDialogs

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
29puhr7.jpg

2wn32fk.jpg

28c1vr8.jpg

2sajn2b.jpg


Example
Quick Alert Dialog:
B4X:
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:
B4X:
    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
 

shashkiranr

Active Member
Licensed User
Longtime User
Getting this error. I do not have the ripple view library added to my libraries folder. :(

B4X:
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
 

shashkiranr

Active Member
Licensed User
Longtime 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 ??
 

thedesolatesoul

Expert
Licensed User
Longtime User
Which version of MSMaterialMenu are you using?
The one in this post: https://www.b4x.com/android/forum/threads/msmaterialmenu-animating-icons.44735/
or the one in this post: https://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: https://www.b4x.com/android/forum/t...-build-navigation-drawers-fast.52972/#content
 

shashkiranr

Active Member
Licensed User
Longtime 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.

B4X:
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
 

ArminKH

Well-Known Member
thank u
have we a chance for custom themes?(for non-english language)
 

™AsAs4242

Member
Licensed User
Longtime User
i have a problem and crash after tick rippleview lib and untick ...

B4X:
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
 

mshafiee110

Active Member
Licensed User
Longtime User
hi @thedesolatesoul
I use from MSmaterialdrawer and MSMaterialDialogs together.

but Error occurs.
pls help me.tnx
 

susu

Well-Known Member
Licensed User
Longtime User
Hi @thedesolatesoul , which is min Android version your MSMaterialDialogs can work on? Thanks!
 

Anser

Well-Known Member
Licensed User
Longtime User
Hi thedesolatesoul,

Any progress on the custom dialogs along with AppCompat ?

Regards,
Anser
 
Top