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,682
  • Dialogs3.00.zip
    48.9 KB · Views: 2,720
  • Dialogs4.01.zip
    72.2 KB · Views: 8,732
Last edited by a moderator:

susu

Well-Known Member
Licensed User
Longtime User
Thank you Agraham. I updated 3 times today and your library is better each time :D
 

tremara1

Active Member
Licensed User
Longtime User
You did it again..

Wow you just knock them out dont you... thanks again the num picker is great.
I tried the demo all went well but just a small thing when I changed the digits to 7 and the number to 1234500 the dialog displayed 00345.00 not a huge problem just a small thing....I hope you dont think I am picky...I am so grateful for your work you do..thanks again.
 

agraham

Expert
Licensed User
Longtime User
I hope you dont think I am picky...
Not at all. If it's wrong it's wrong! However - actually it's not, at least not in the library!

The demo itself is wrong, you should set the number of digits before setting the number value, not after, so the correct number of digits are loaded into the dialog on intialisation. As written it is using the default number of 5 digits which is why you see what you see.
 

tremara1

Active Member
Licensed User
Longtime User
thanks......again

thanks, I appreciate your response.....
 

alfcen

Well-Known Member
Licensed User
Longtime User
It is a masterpiece, indeed, and perhaps I should not ask, but my curiosity has been triggered:

1. Is a date picker as attached possible? Looks aiphony but is actually from an Android app.

2. Could the Number Picker be modified to accommodate negative numbers?
The idea is manual input of geo coords.
 

Attachments

  • datedrum.jpg
    datedrum.jpg
    12.6 KB · Views: 605

agraham

Expert
Licensed User
Longtime User
1 - That dialog is housing a custom written View. I won't be attempting anything like that as I don't do graphics stuff if I can possibly avoid it.

2 - I'll add an option for the leftmost digit to be a + or a - character according to the sign of the initial number and make it changeable by the user.
 

agraham

Expert
Licensed User
Longtime User
Version 1.5 now posted has the option for the display and entry of a sign character in NumberDialog as requested above. This is achieved by an added ShowSign property and the maximum number of digits is increased to 9.

There are some other minor changes to InoutDialog. Hint and HintColor properties and INPUT_TYPE_PHONE and INPUT_TYPE_NONE constants are added. Also the SingleLine property was removed as it was non-functional because InputDialog is always a single line.
 

susu

Well-Known Member
Licensed User
Longtime User
Mr. Agraham, can you develop some kind of "open file dialog" ? It will be very useful :D
 

agraham

Expert
Licensed User
Longtime User
Version 1.6, now posted, has a modal FileDialog that can be used as both a file open and a file save dialog.

Folders are listed in the top part of the scrolling list in the dialog and files, if any, are listed in the bottom half. Touching a folder moves into it, touching ".." moves back and touching a file name enters it into the EditText at the top of the dialog. A user can enter a new filename into the EditText or can edit a selected file name. The present folder and filename, if any, can be retrieved when the dialog is closed by the user.
 

moster67

Expert
Licensed User
Longtime User
Very useful. Thanks Agraham!

Version 1.6, now posted, has a modal FileDialog that can be used as both a file open and a file save dialog.

Folders are listed in the top part of the scrolling list in the dialog and files, if any, are listed in the bottom half. Touching a folder moves into it, touching ".." moves back and touching a file name enters it into the EditText at the top of the dialog. A user can enter a new filename into the EditText or can edit a selected file name. The present folder and filename, if any, can be retrieved when the dialog is closed by the user.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Sir Andrew, you are a "bloody legend". By all means, awesome work:sign0098:
Surely, Erel is right now playing with it with a big smile on his face which I have never seen.
 

susu

Well-Known Member
Licensed User
Longtime User
Thank you! Updated :D
 

Amalkotey

Active Member
Licensed User
Longtime User
Thank you for the great work!

Hello Andrew,

thank you for the great work!

regards
Amalkotey
 

agraham

Expert
Licensed User
Longtime User
I guess this is about the end of modal dialogs unless someone comes up with a good idea. Version 1.8 includes a CustomDialog which displays a Basic4Android Panel so you can show your own layouts as a modal dialog. I'm not totally happy with it as there seems to be no mechanism I can find for finding the maximum size of the area within a dialog so the sizing and positioning of the panel and its controls needs a bit of guesswork.

A minor change to FileDialog is that the scrolled position used to be inherited when you entered a child folder. Now it is reset to the top.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Hope this is a good idea to justify Ver 1.9 :)

You could crown the NumberDialog with nd.Max = xx and nd.Min = yy,
i.e., if you tap on + or - it will stop inc/decrementing as the set limits are reached.

Of course, this can be caught in a If clause or in a Sub, but if the Lib would take care of that the source will suffice with less code lines.

No rush on that.
 

agraham

Expert
Licensed User
Longtime User
You could crown the NumberDialog with nd.Max = xx and nd.Min = yy,
I tried this but won't put it in for two reasons.

Firstly and mainly, unlike a NumUpDown spinner where you can see the limit approaching, because you adjust the individual numbers it doesn't "feel" right when you try to increment or decrement a high order number and it doesn't change because of the limits.

Secondly.,because internally the library is actually dealing with individual characters in individual controls and not actual numbers the logic of maintaining the consistency across the number displayed and the maximum and minimum got out of proportion to my perceived benefit of implementing the change.
 

alfcen

Well-Known Member
Licensed User
Longtime User
I do understand the limitations, in particular the second reason.
Thanks very much, indeed, for looking into this.
 
Status
Not open for further replies.
Top