B4A Library Dialogs library

Status
Not open for further replies.
This library contains several modal, that is blocking, dialogs by which the user can enter data. Presently they are an InputDialog for numbers and text, a TimeDialog for times and and a DateDialog for dates.

Note that modal dialogs can close unexpectedly and not return to your code if the Activity needs to close, most likely because the user rotated the device. There is a brief discussion of this in the overall library help in the xml. This can also occur with the Basic4android modal dialogs InputList, InputMultiList, Msgbox and Msgbox2 whose modal mechanism is used by the dialogs in this library.

Edit : - Version 1.1 posted with minor bug fix. See post #6 for details.

Edit : - Version 1.2 posted with Color dialogs. See post #16 for details.

Edit : - Version 1.3 posted with bug fix. See post #19 for details.

Edit : - Version 1.4 posted with a Number dialog. See post #20 for details.

Edit : - Version 1.5 posted with some enhancements. See post #28 for details.

Edit : - Version 1.6 posted with a File Dialog. See post #30 for details.

Edit : - Version 1.7 posted with a minor UI change. See post #33 for details.

Edit : - Version 1.8 posted with a Custom dialog. See post #37 for details.

Edit : - Version 1.9 posted with a bug fix. See post #42 for details.

Edit : - Version 2.0 posted with a bug fix. See post #48 for details.

Edit : - Version 2.1 posted with a second Custom dialog. See post #68 for details.

Edit : - Version 2.2 posted. See post #75 for details.

Edit : - Version 2.3 posted. See post #90 for details.

Edit : - Version 2.4 posted. See post #135 for details.

Edit : - Version 2.5 posted. See post #148 for details.

Edit : - Version 2.6 posted. See post #155 for details.

Edit : - Version 2.7 posted. See post #168 for details.

Edit : - Version 2.8 posted. See post #206 for details.

Edit :- Version 2.91 posted by Mildev. See post #317 for details. His version 2.91 is based on my unpublished v2.9 which set the text box in FileDialog to SingleLine mode.

Edit : - Version 2.92 posted. See post #341 for details.

Edit (Erel): Version 3.00 posted. Developers using B4A v6.80+ should use this version.

V4.01 is released with several improvements: https://www.b4x.com/android/forum/t...-dialogs-and-async-methods.80204/#post-507930

B4A version | Dialogs library version
------------------------------------
7.0+ 4+
6.8 3.00
<6.8 2.92
 

Attachments

  • Dialogs2.92.zip
    59.4 KB · Views: 12,713
  • Dialogs3.00.zip
    48.9 KB · Views: 2,751
  • Dialogs4.01.zip
    72.2 KB · Views: 8,839
Last edited by a moderator:

thedesolatesoul

Expert
Licensed User
Longtime User
It's Android that doesn't support modality, not Java. Basic4android implements its own modality mechanism and Msgbox and my Dialogs library use that. The dialogs themselves are indeed based on Android Dialogs.

Sorry, that is what I meant. But good to clarify. So if I do implement my own dialogs is there anything I need to add to support modality?
Thanks.
 

agraham

Expert
Licensed User
Longtime User
I want to port some dialogs (for eg progress dialog)
You probably don't want a modal progress dialog. While a modal dialog is displayed none of your other code can run - except possibly events raised from views displayed on the dialog. The existing Basic4android ProgressDialog does not use the modal mechanism and displays a standard Android ProgressDialog.

B4X:
is there anything I need to add to support modality?
Yes. call anywheresoftware.b4a.Msgbox.msgbox(MyAlertDialog, false) to display a modal dialog. Note that only AlertDialogs are accepted.

EDIT:- Passed on the inside while preparing the answer! :(
 

thedesolatesoul

Expert
Licensed User
Longtime User
You should call:
Note that the internal implementation of modal dialogs is very (very) complicated.
All the more reason to appreciate B4A developers efforts!:)

You probably don't want a modal progress dialog. While a modal dialog is displayed none of your other code can run - except possibly events raised from views displayed on the dialog. The existing Basic4android ProgressDialog does not use the modal mechanism and displays a standard Android ProgressDialog.

I was talking about an AlertDialog with a progressbar.
The code will be running in a service and the UI will be updated.
I am now thinking this will be too complicated.

B4X:
is there anything I need to add to support modality?
Yes. call anywheresoftware.b4a.Msgbox.msgbox(MyAlertDialog, false) to display a modal dialog. Note that only AlertDialogs are accepted.
[/QUOTE]
If there are no buttons on the dialog (only lists) how does the modality end? Does it detect for 'touch' anywhere? Or when you code on an event (List_Click) to hide the dialog.

I think this is getting quite hard for me!!!
 

brainfart

Member
Licensed User
Longtime User
Ways to include HTML link in a Dialog

Hello.
Can someone advise of a simple way to add a HTML link to a dialog box.
The only way I know is adding a label with the right color and underline to make it look like link and then in its click event use intent.

Is there a simpler way to add a HTML link to a dialog?
I am trying to put a link to the publishers website in an "About" CustomDialog2.

Thanks
 

moster67

Expert
Licensed User
Longtime User
@brainfart

Did you see my reply in this very thread?

Inviato dal mio Nexus One usando Tapatalk
 

brainfart

Member
Licensed User
Longtime User
:sign0161:
Sorry. This thread is so convoluted that I did not see your reply.
I just looked for a reply right bellow mine in hybrid view instead of chronological order.

I will give your suggestion a try.

Thank you.
 

agraham

Expert
Licensed User
Longtime User
I would be happy to provide a three slider version of ColorDialog that does Hue, Saturation and Value/Luminance if that's what you want but I won't try touch selection on a gradient in a 2D panel as I don't think the precision on these capacitive touch screens is good enough for it to work well.
 

boten

Active Member
Licensed User
Longtime User
agraham;61349.... said:
I don't think the precision on these capacitive touch screens is good enough for it to work well.
u'r right of course. Never mind.
 

agraham

Expert
Licensed User
Longtime User
In version 2.4, now posted, thanks to an observation by mikecox codified by JesseW the InputDialog and the two CustomDialogs will now close the soft keyboard on exit if it was left showing.

FileDialog.FileFilter now accepts either a single filter value like ".txt" or a comma separated list of values like ".jpg,.png". Note that spaces in filter values are significant and are not ignored. If a filename contains the text of any one of the filter values the file will be displayed.
 

AscySoft

Active Member
Licensed User
Longtime User
Yes! It does working... I tested it on my project, an InputDialog (used for password, just like a logIn form without all the coding) , now the soft keyboard's gone.

It will be great also in the future if changing orientation would not destroy Dialogs!
Until then, 'mucho respeto' (and after, of course) :sign0188:
 
Last edited:

agraham

Expert
Licensed User
Longtime User
I see you found PasswordMode!

It will be great also in the future if changing orientation would not destroy Dialogs!
That will never be possible because of the way Android is designed. The activity showing the dialog is destroyed, and therefore so is the dialog, and a new activity is created in the new orientation.
 

AscySoft

Active Member
Licensed User
Longtime User
I see you found PasswordMode!
Yes.. that's why I edited previous post... silly me!

That will never be possible because of the way Android is designed. The activity showing the dialog is destroyed, and therefore so is the dialog, and a new activity is created in the new orientation.
So this mean that in Activity Create first time to set a boolean=true (global process variable) only if InputDialog got something,...
...
if not (user change orientetion/ dialog destroy)
...
do something in Activity Resume, check if bool value=true, else redisplay input dialog?!
Thanks for your quick reply!
Probably would work, but i think is not (so) ideal...
 

Amalkotey

Active Member
Licensed User
Longtime User
expansion of the lib

Hi Andrew,

I miss a wait dialog, See in Android Developer. There is the permutations that the dialogs libbrary is extended dialogue with this?

regards
Amalkotey
 

Attachments

  • dialog_progress_spinning.png
    dialog_progress_spinning.png
    2.6 KB · Views: 250
Status
Not open for further replies.
Top