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,951
  • DateDialog2.bas
    5.2 KB · Views: 1,058
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
Nice update Andrew...
 

Johan Hormaza

Well-Known Member
Licensed User
Longtime User
Thank you!
I needed it, since version 4.01 had the problem of not showing the keyboard, let alone hiding it, but this version has solved that problem and not only that, but it is also optimized.
Because, there are already some dialogues and there the decision is better, if I see directly in the thread as the dialogue looks, without having to try the demo. :)
You should try, what's more, it would completely replace the previous library!
 

asales

Expert
Licensed User
Longtime User
Post here if you find any problems.

In Moto G5 Plus (first image) the last day of the month is cutted.
In Moto G4 (second image), the last day is cutted, but I see a scrollbar.
Would be nice if I can ajust it without the scrollbar.
datedialog1a.jpg
datedialog2a.jpg
 

wes58

Active Member
Licensed User
Longtime User
I am not sure whether it is a bug or whether it supposed to be like this.
After you open Time Dialog, pressing Yes/No doesn't dismiss the dialog (you can see that dialog closes and opens again). You have to press Yes/No again for the dialog to close.
 

agraham

Expert
Licensed User
Longtime User
After you open Time Dialog, pressing Yes/No doesn't dismiss the dialog (you can see that dialog closes and opens again)
It's a bug in the demo left over from adding choice of Sync or Async. Delete lines 109 and 110 in the demo.

Note that you would be probably be better off using TimeDialog2. If you look at TimeDialog in landscape you will probably see that it doesn't display properly.
 

Glen Ponder

Member
Licensed User
Longtime User
Hi, thanks for the great library. Downloaded the demo and tested it on my OnePlus 6T running Android 9 with OxygenOS 9.0.15

My reply is regarding DateDialog & TimeDialog.

Attached are 2 screenshots as per the Date Dialog demo with message, title and icon and 2 screenshots where I have removed the message, title and icon.

Similar to the original DateDialog library when I open the dialog there is a white border around the top and right sides.

Whilst the border is superficial it does look a bit odd and not flush, neat and square. Any chance the border can be removed?

A border also appears on the top of the Time Dialog.

Many thanks
 

Attachments

  • Demo_Landscape.jpg
    Demo_Landscape.jpg
    192.7 KB · Views: 749
  • Demo_Portrait.jpg
    Demo_Portrait.jpg
    192.2 KB · Views: 759
  • Preferred_Landscape.jpg
    Preferred_Landscape.jpg
    166.7 KB · Views: 743
  • Preferred_Portrait.jpg
    Preferred_Portrait.jpg
    171.2 KB · Views: 723

Glen Ponder

Member
Licensed User
Longtime User
thanks for the swift response, but i am not getting a scroll bar and unlike the images in #9 where the border is flush I get the white border. If you are saying it is a Android problem then fair enough.
 

Alessandro71

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

I just updated one of my projects from android:targetSdkVersion="28" to android:targetSdkVersion="29" and the FileDialog doesn't show any files anymore.
Rolling back to 28 works as expected
 
Top