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

alfcen

Well-Known Member
Licensed User
Longtime User
Hi Andrew,
This is truly lovely. The dialogs are versatile and fully customisable, yet simple to use. Exactly what developers need for astronomy applications!
Thanks so much for your work!

Robert

PS: Your option "Maybe" is cute :icon_clap:
 

Amalkotey

Active Member
Licensed User
Longtime User
Hi Andrew,

how can I display the date dialog? I always get the subsequent message when you compile.

B4X:
Compiling code.                         Error
Error compiling program.
Error description: Missing parameter.
Occurred on line: 48
Calendar.Show("prompt", "Kauf-Datum", "OK", "Abbruch", imgCalendarDown)
Word: )

Can you give me an example?

regards
Amalkotey
 

Amalkotey

Active Member
Licensed User
Longtime User
Ok, Found.

Runtime-Error: java.lang.IlligalArgumentException
current should be >= start and <= end

Regards
Amalkotey
 
Last edited:

Amalkotey

Active Member
Licensed User
Longtime User
Hello,

I found the error. Works fine. Thank you.

regards
Amalkotey
 

agraham

Expert
Licensed User
Longtime User
Version 1.1 has a bug fix to DateDialog.DateTicks. Java/Android count months from 0 to 11, Basic4android and Basic4ppc count them from 1 to 12. When setting the initially displayed date using DateTicks the displayed month was off by one because I omitted to do the correction. Reading the ticks value from DateTicks was fine, I got that right, it was just the inital setting that was off.
 

WZSun

Member
Licensed User
Longtime User
Hi Agraham,
Not sure whether there is a bug in the DateDialog...

Instead of using the + - to adjust the date, I tap on the say, Year field.. and it pops up the keyboard. I then manually entered say, 1996. When I confirmed the date, the year was displayed as 2010 (current year) and not 1996.

Sometimes the DayOfMonth field was displayed a day earlier. For example, sometimes I manually changed the day to 16.. it displayed them as 15.

I thought it was my scripts. I then launched your sample demo... I manually entered the year as 1996.. but it shows as 2009 once in a while.
 

agraham

Expert
Licensed User
Longtime User
It seems to be a "feature" of the actual Android DateDialog that if you enter a number by the keyboard it doesn't "stick" until you press + or - or move the focus to another date element. I am afraid that I don't think there is anything I can do in the library as there is no interaction possible in code with the dialog between showing it and receving the values back when the user closes it. :(
 

WZSun

Member
Licensed User
Longtime User
Hi agraham.
Thanks for the useful insight. Yeah.. since it's a "feature", I guess there's nothing that can be done.

Once again.. thanks for the great work in producing the libraries!
 

tremara1

Active Member
Licensed User
Longtime User
Number dialog

Any chance of a dialog with number input with +/- selector similar to the date dialog....just thought I'd ask. I really appreciate all the work you guys do with the libraries.
 

JesseW

Active Member
Licensed User
Longtime User
Phone keypad support

If anyone is interested, you can use the phone keypad in AGraham's input dialog, like you can in the core object EditText view. Simply do it like this:

B4X:
Dim id as InputDialog
dim et as EditText
id.InputType = et.INPUT_TYPE_PHONE
result = id.Show(...)

I'm sure there is an integer constant value that can be used instead, but this is very readable.
And best of all, it works very nicely. :sign0162:
 

gjoisa

Active Member
Licensed User
Longtime User
Is it possible to use date dialog in the format of dd/mm/yyyy ?
 

agraham

Expert
Licensed User
Longtime User
I assume you mean the layout of the actual Dialog which seems to be governed by the locale set under Language and Keyboard Settings. On an emulator set to English(United States) to it shows as [mm dd yyyy]and set to English(United Kingdom) it is [dd mm yyyy]
 
D

Deleted member 103

Guest
Hi agraham,

It is an error or is it can show the date not more than 2100?
For certain calculations, it would be necessary.


Ciao,
Filippo
 

Attachments

  • Date-Dialog.jpg
    Date-Dialog.jpg
    16.9 KB · Views: 2,684

agraham

Expert
Licensed User
Longtime User
Version 1.2, now posted, includes two more modal dialogs to obtain color choices from a user. One allows the user to specify the R, G and B values of a color using sliders and the other gives the user a choice from 16 predefined colors.

It would have been nice to combined the functions in one dialog but lack of space in a dialog precludes doing this in a easily usable way.
 

tremara1

Active Member
Licensed User
Longtime User
GetColor2

I just tried the updated dialog lib. You have done a great job but I seem to have a problem with GetColor2 is a blank dialog with the response buttons. Is it me??.....also any further dialogs in the future ie a number picker with +/- selection. Thanks again.
 

agraham

Expert
Licensed User
Longtime User
That's very, very strange :confused: The demo layout is for a 240 x 320 density 1 screen and it works fine on my 480 x 800 density 1.5 phone so I would have thought it would work anywhere. However I just tried it on the 240 x 320 density 1 emulator and it doesn't appear so at the moment I am totally baffled! I'll look further tomorrow.

There isn't a pure number picker dialog available in Android so there won't be one in the Dialogs library I'm afraid.
 
Status
Not open for further replies.
Top