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: 13,037
  • Dialogs3.00.zip
    48.9 KB · Views: 2,976
  • Dialogs4.01.zip
    72.2 KB · Views: 9,658
Last edited by a moderator:

joneden

Active Member
Licensed User
Longtime User
I've mucked around with the reflector lib and added an on touch event. That only works when clicking on the spinner main box - it doesn't handle the itemclicked event :( I think that the only option that I can work with for now is to add an imageview to the right of the spinner and use that as the click event. The user will have to select from the drop down then click the image - better than reworking the form!
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
Hi There!

I am looking to make a modal dialog to enter a pin code. I got a printscreen from a youtube video of what i meant, it is attached.

I dont want to use the android keyboard.

I have not figured out using the dialog how to do that.

Thanks
 

Attachments

  • pin dialog.png
    pin dialog.png
    94.7 KB · Views: 298

Informatix

Expert
Licensed User
Longtime User
Hi There!

I am looking to make a modal dialog to enter a pin code. I got a printscreen from a youtube video of what i meant, it is attached.

I dont want to use the android keyboard.

I have not figured out using the dialog how to do that.

Thanks

If you have a specific need, you can do easily the same thing with two panels: one for the dialog, and one, behind, occupying the whole screen, to block touch events.
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
If you have a specific need, you can do easily the same thing with two panels: one for the dialog, and one, behind, occupying the whole screen, to block touch events.

Thank You Informatix. After more searching i have found your library Floating window and that is helping me a lot.

I am using it to display the pind pad. I have created before it showing a semitransparent panel to somewhat hide the application behind. I am getting the OnMove event to force the windows to be pinned. There is no option to create a windows already pinned, only the user can do that.

I know you make this to be modaless, however what can be done for the user do not click on the other buttons behind?

Many thank for your source code, I am learning a lot from it.
 

Informatix

Expert
Licensed User
Longtime User
There is no option to create a windows already pinned, only the user can do that.

Yes, I forgot to add this function. Since you have access to the source code, you can add it easily.

I know you make this to be modaless, however what can be done for the user do not click on the other buttons behind?

Place a panel between the floating window and the other views, and create a OnTouch handler for this panel (even empty).
 

arp

Member
Licensed User
Longtime User
Enhancement request

Hi agraham,

thanks for this fabulous library. Can I ask for a modification to the TimeDialog to allow the selection of seconds as well, thanks.
 

Comalco

Member
Licensed User
Longtime User
Change Size of ColorDialogHSV

I scrolled tyhrough most pages in this thread and couldnt find any mention of changing the overall size/scale of the color dialog box?

I love the layout as it is, except I would like to make it smaller overall.
Is there a syntax to set the size of the dialog - while still keeping the color bars etc all in scale?

Ideally I would like to make the entire dialog about 1/2 or 2/3 its defualt size.

Is there a way of doing this in the AGraham Dialogs library?
 

joneden

Active Member
Licensed User
Longtime User
Resume after another activity

In a custom dialog that I have, I have a button that the user can press to take a photo. When that happens when the user presses the button is that the custom view is saved to a variable, then the photo activity is launched.

Once the user has taken a photo or cancelled it, the activity returns. The procedure that is called tries to restart the dialog using the standard dialog.show command. At this point I get an error as below:
"The specified child already has a parent. You must call removeView on the child's parent first."

Is there a way to redisplay the original dialog - it's almost as if it's open but just hidden from view. Even better would be not having it close in the first play but that seems to be impossible if loading another activity...

Regarsd,

Jon
 

Comalco

Member
Licensed User
Longtime User
Even with the dialog size fixed, its still a great library......thanks. I guess the alternative is to re-create a specific dialogue with a panel and separate controls and make that smaller.......a good learning activity forme. Thanks again.
 

arp

Member
Licensed User
Longtime User
Standard View?

Thanks for the reply, agraham.

Do you know of a "standard" view for the number selector in the dialogs? Or is it constructed on a listview or scrollview or similar?

would like to make the time selector with seconds look as uniform as possible with the other dialogs.

I really appreciate the time you all put into this forum, and the enhancements via libraries etc.
 

agraham

Expert
Licensed User
Longtime User
The numeric up-down is an internal Android View used by Android to implement the dialog. It is not available to programs. Look at the first answer here.

EDIT :- I've just noticed it is exposed in Android SDK 11 and up. It would need a library to wrap and expose it. There's a job for somebody. :)
 

arp

Member
Licensed User
Longtime User
many thanks for the reply. seems a bit silly on Googles part not to expose standard UI elements - especially when they harp on about consistency of user experience etc.

Will see what I can get from that link - maybe time to figure out how to do libraries..... Thanks again. :sign0188:
 

Inman

Well-Known Member
Licensed User
Longtime User
Does CustomDialog2 have some sort of padding inside it? This is all I did.

B4X:
Dim cd As CustomDialog2, pnlone as Panel
pnlone.Initialize("")
pnlone.Color=Colors.Blue
cd.AddView(pnlone,468dip,400dip)
cd.Show("Dialog","","","",Null)

Here is the screenshot

4ygj1.jpg


Notice the gap on left and right edges? Why is this happening? I want the panel to fill from left edge to right edge.

Then I changed CustomDialog2 to CustomDialog and used cd.AddView(pnlone,0,0,468dip,400dip) instead. And this is what I got.

zMRfk.jpg


My device is Asus Transformer TF101 tablet running Android 4.0.3.
 

thedesolatesoul

Expert
Licensed User
Longtime User
Read the docs: Basic4android - Dialogs
It says:
CustomDialog2

This modal dialog displays a custom set of controls laid out on a Basic4android Panel.
The Panel will be automatically centred in the displayed dialog.
CustomDialog2 centres things, while CustomDialog uses Absolute positioning.
 

Inman

Well-Known Member
Licensed User
Longtime User
I understand that. But is it possible to make the panel fill from left edge to right edge?
 

padvou

Active Member
Licensed User
Longtime User
Input dialog for email address

Is it possible to somehow show the relevant IME with the "@" when i want a user to enter an email address in an input dialog?
Thank you
 
Status
Not open for further replies.
Top