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

Discussion in 'Additional libraries, classes and official updates' started by agraham, Jun 21, 2019.

  1. agraham

    agraham Expert Licensed 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.

    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.

    Attached Files:

    Hasan Ali, Levit, XbNnX_507 and 28 others like this.
  2. AscySoft

    AscySoft Active Member Licensed User

    Some screenshots would be nice!
    Frank.G, KZero, ShaneG30 and 2 others like this.
  3. agraham

    agraham Expert Licensed User

    Why? Just run the demo.
  4. Johan Hormaza

    Johan Hormaza Active Member Licensed User

    Good Job!!
  5. Peter Simpson

    Peter Simpson Expert Licensed User

    Nice update Andrew...
    agraham likes this.
  6. agraham

    agraham Expert Licensed User

    If you are too lazy to try it then please feel free to ignore the library. It's your loss not mine.
  7. Johan Hormaza

    Johan Hormaza Active Member Licensed 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.
    You should try, what's more, it would completely replace the previous library!
    Peter Simpson likes this.
  8. agraham

    agraham Expert Licensed User

    That's the idea. Post here if you find any problems.
  9. asales

    asales Well-Known Member Licensed User

    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
  10. agraham

    agraham Expert Licensed User

    That's an Android problem that I cannot fix. TimeDialog has similar problems. That's why I provided TimeDialog2 and DateDialog2.
    asales likes this.
  11. wes58

    wes58 Active Member Licensed 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.
  12. AscySoft

    AscySoft Active Member Licensed User

    It's ok, I get it...but if you are having some free time, it would be a nicer "representation" of your new library. Please ignore this comment;)
  13. agraham

    agraham Expert Licensed User

    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.
  14. Glen Ponder

    Glen Ponder Member Licensed 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

    Attached Files:

  15. agraham

    agraham Expert Licensed User

    See post #9 above and my reply at #10.
  16. Glen Ponder

    Glen Ponder Member Licensed 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.
  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