afollestad MaterialDialogs reborn

DonManfred

Expert
Licensed User
Longtime User
No, sorry... Been busy
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Another problem :-(

itemsCallbackMultichoice has the following definition:

B4X:
itemsCallbackMultichoice(selectedIndices() as Integer) as MaterialDialog

However, when I do this:

B4X:
dialog.itemsCallbackMultiChoice(Array As Int(1,2))

the program doesn't compile (Cannot cast type Int to Integer - how the hell do you do this in B4A?)

I've tried with

B4X:
dialog.itemsCallbackMultiChoice(Array As Object(1,2))

as well but this results in a java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.lang.Integer[]
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Thanks, this is a blocking issue in an app I'm working on... :-(
 

wimpie3

Well-Known Member
Licensed User
Longtime User
When using the progress dialog, I get
B4X:
java.lang.NoClassDefFoundError: Failed resolution of: Lme/zhanghai/android/materialprogressbar/IndeterminateProgressDrawable;
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Thanks for taking a look at this library, it needs some TLC :)

The code that crashes is:
B4X:
Dim pd1 As MaterialDialog
pd1.Initialize("")
pd1.title("Getting file list")
pd1.progressIndeterminateStyle(False)
pd1.progress(True,0)
pd1.show

By the way, there is a show for the progress dialog, but no hide?
 

wimpie3

Well-Known Member
Licensed User
Longtime User
Thanks for your efforts, but still some problems.

Messagebox and Inputbox seem to work ok.

Checkboxes are not:

B4X:
dialog.Initialize("sd1")
dialog.items(Array As String("Apple ", "Orange", "Grapes","Pineapple","Mango" ))
dialog.itemsCallbackMultiChoice(Array As Int(1,2))
[code]

crashes with:

[code]android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class <unknown>

Also, is it correct that #AdditionalJar: com.android.support:recyclerview-v7 is no longer needed? The library works fine as well without #AdditionalRes: ..\res.commons and #AdditionalRes: ..\res.MaterialProgressBar
 

wimpie3

Well-Known Member
Licensed User
Longtime User
What is the signature for the onSelection function call? I now have this:
B4X:
Sub mcd1_onSelection(selected() As Int, strings() As string)
But this crashes with:
B4X:
java.lang.Exception: Sub mcd1_onselection signature does not match expected signature.
 

DonManfred

Expert
Licensed User
Longtime User
already got the single and multiselect working
they are working (does not crash) but the callbacks are not called :-(
damned library... I´m loosing the mood on it

edit: the issue was a missing parameter in the builder.
if you dont call alwaysCallMultiChoiceCallback then you only get a event when pressing a button.

But now it works....

** Activity (main) Resume **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
itemsCallbackMultiChoice
lib: NOTFOUND 'dialog_onshow
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@296caf6,[Ljava.lang.String;@c4f8ef7)
Selected: 0 -> Hallo
Selected: 1 -> B4X
Selected: 2 -> World!
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@e1fa8df,[Ljava.lang.String;@469092c)
Selected: 1 -> B4X
Selected: 2 -> World!
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@e5eb3f4,[Ljava.lang.String;@bdf271d)
Selected: 1 -> B4X
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@e4071bc,[Ljava.lang.String;@77fe545)
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@e3e90c1,[Ljava.lang.String;@704a066)
Selected: 2 -> World!
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@faa5cf2,[Ljava.lang.String;@9077f43)
Selected: 0 -> Hallo
Selected: 2 -> World!
onSelection
lib:Raising.. dialog_onselection()
Dialog_onSelection([I@d98cc9f,[Ljava.lang.String;@a61c1ec)
Selected: 0 -> Hallo
Selected: 1 -> B4X
Selected: 2 -> World!

Edit: Lib in post #1 updated to V1.12
 
Last edited:

wimpie3

Well-Known Member
Licensed User
Longtime User
With 1.12 the message boxes don't show up on the screen. No alerts, no input boxes, no wait window... nothing!
 

wimpie3

Well-Known Member
Licensed User
Longtime User
All my apps stopped showing the alerts with 1.12 and the demo code on Page 1 isn't working either.
 

wimpie3

Well-Known Member
Licensed User
Longtime User
I have discovered why the lib was not working anymore since 1.12. A "build" command is now necessary before a "show" command. That was not the case before.
 
Top