B4A Library Dialogs2 library - an update to the original Dialogs library

Note the separate download for an updated Dialogs2 class that fixes a bug in the original.

I wrote the original Dialogs library many moons ago and it has suffered with age owing to the changes made to Android and B4A over the years despite the administrations of several other people.

Although modal dialogs are deprecated in general they are still very convenient for use with my BasicIDE on-device development environment which does not implement Wait For, although there is an ugly workaround. Therefore I have taken the Dialogs v4.01 source code and updated it into a new Dialogs2 library.

Every dialog, except CustomLayoutDialog now supports both Show and ShowAsync. In past editions of B4A events raised by views on a CustomDialog or CustomDialog2 would run while the dialog was shown modally but over the years Erel has had to change the Msgbox mechanism as Android has (d)evolved and now custom dialogs that relied on events from views on the dialog no longer work as expected. For example in the reworked CustomDialog2 example in the DialogsDemo file the ListView ItemClick no longer works when Show is invoked but is fine with ShowAsync while a Button Click works in both cases.

Several of the dialogs would also not work properly in landscape on modern devices with tall narrow screens and higher display densities, I hope they all do now.

The DateDialog and TimeDialog are also problematic in landscape mode which Google doesn't seem to want to fix so I have included alternative TimeDialog2 and DateDialog2 classes in the demo which work for me and hopefully also for you.

EDIT: Dialogs 1.2 Posted. FileDialog now has a TextSize property.

EDIT2: See this link for a fix for a fix to a problem in DateDialog2.

EDIT3: Replace the Dialogs2.bas class in the demo with the separately posted one below to fix the above bug.
 

Attachments

  • Dialogs2_v1.2.zip
    89.2 KB · Views: 1,998
  • DateDialog2.bas
    5.2 KB · Views: 1,089
Last edited:

kiki78

Active Member
Licensed User
Longtime User
Dear Agraham,

I try to launch joined DialogsDemo to test this library and i receive following error.

B4X:
B4A Version : 11.50
Analyse du code.    (0.01s)
    Java Version : 11
Building folders structure.    (3.76s)
Compilation du code.    (0.15s)
Compilation du code des layouts.    (0.07s)
Organiser les bibliothèques.    (0.02s)
    (AndroidX SDK)
Resources de compilation    (0.69s)
Resources de chaînage    (0.73s)
Compilation du code Java.    (4.25s)
Finding libraries that need to be dexed.    (0.01s)
Dex: Dialogs2    Error
Error in flag file argument: '@d8_arguments.txt':
File not found: d8_arguments.txt
Compilation failed

For infomation, "d8_arguments.txt" file is present in Objects directory.

Have you some idea ?

Regards,
 

kiki78

Active Member
Licensed User
Longtime User
I use B4A 11.50 with SDK 30.
I install SDK 32 and it now work :)
Thank you Agraham
 

agraham

Expert
Licensed User
Longtime User
I install SDK 32 and it now work
What is 'SDK 32' and where did you get it from? Are you not using the official SDK from here which is for Android API 30? If not why not?
 

kiki78

Active Member
Licensed User
Longtime User
I use B4A SDK Manager.
I download Android SDK Platform 32.
Then select android-32/android.jar.
 

kiki78

Active Member
Licensed User
Longtime User
One more time you have reason :)
I re-download sdk from B4A page and know problem is gone with API 30.
I don't remember where I found previous.
Regards,
 
Top