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,629
Last edited by a moderator:

moster67

Expert
Licensed User
Longtime User
compatibility issue with Honeycomb??

I have a user who is using my app running Honeycomb. There was a spinner-issue but this has been resolved with the latest version of B4A (1.6). Now he reports force-close upon selecting an item in a dialog.

My app running on the user's other device running Android 2.2 does not present this problem.

I am still awaiting some more information from this user so I may understand the nature of the problem but I thought I would just ask in the meantime if anyone is aware about compatibiliy-issues with Dialogs running Honeycomb (Samsung Tablet 10.1 - the new one)?
 

boten

Active Member
Licensed User
Longtime User
I just tried the DialogsDemo that comes with the Dialog library. On the emulator the DateDialog displayed Jul 18 2011 and the TimeDialog displayed 10 29 AM (hours value 1-12)
When I run it on the real device (Samsung Galaxy S) it showed the date as 18 Jul 2011 (as per the dateformat on the device's settings) but the time was still showing AM(PM) although my device is set to show 24 hours format.
I realise there is a "Is24Hours" attribute and when set to True shows the TimeDialog in 24 hrs format.
My question is how do I determine, programatically, which time format the phone is set to?

tia,
nbp
 

moster67

Expert
Licensed User
Longtime User
@Erel: thanks but it would be difficult for you to run it (especially the suspected routine) since the app requires a particular satellite-decoder in your network.

@agraham: your information is good to know since you tried it on a Honeycomb-device

I believe the problem is due to a network-routine (and thus a problem in the user's LAN) which is triggered upon selecting an item in the Dialog rather than a Dialog-problem. That's why I hope to get a more detailed report from the user but I thought I would ask anyway if any problems were known (like the spinner-view).

In addition, I have not received any other bug-reports for this issue despite my app has more than 12000 active installs of which 361 installed on honeycomb-devices. Therefore, I hope the issue is depending on something else.
 

moster67

Expert
Licensed User
Longtime User
Good idea! Could also be useful in case of future problems. Thanks.

You could ask your user to install CatLog from the market and to send you a saved system log when the error occurs. That way you might get a stack trace of what's happening.
 

agraham

Expert
Licensed User
Longtime User
My question is how do I determine, programatically, which time format the phone is set to?
With my Reflection library.

B4X:
   Dim Obj1 As Reflector
   Dim args(1) As Object
   Dim types(1) As String   
   args(0) = Obj1.GetContext
   types(0) = "android.content.Context"
   Obj1.Target = Obj1.RunStaticMethod("android.text.format.DateFormat", "is24HourFormat", args, types)
   Msgbox(Obj1.Target,"is24HourFormat")
 

boten

Active Member
Licensed User
Longtime User
thx. worked like charm. Might be useful to incorporate into b4a?
 

Omar

Member
Licensed User
Longtime User
Hello Andrew,

Thank you for this fantastic library, appreciate your efforts to help us.

Just noticed an issue with the DateDialog which I wanted to confirm:

When I enter the date manually with the keyboard the Month and Day value are returned correctly but the Year value returns only the initialized value or the last value selected using the "+" "-" buttons.

I know you have mentioned earlier in the thread regarding the Time Dialog that this is OS related, just curious why the other field are updating and only the Year does not.
 

Widget

Well-Known Member
Licensed User
Longtime User
Agraham,
Very nice dialog library. Congrats.:sign0060:

1) Is there a way for FileDialog's FileFilter to show only files ending in .BMP or .JPG or .PNG? I can only get it to recognize one file extension. I thought I should be able to use ".BMP;.JPG;.PNG" with a ";" delimiting the extensions, but no such luck.

2) It would be nice if the FileDialog had another property FileMustExist that would be set to True to prevent the user from entering a file name that doesn't exist. I have written a sub to do this, but I thought it would be neat if it was self contained in the dialog.

Widget
 

agraham

Expert
Licensed User
Longtime User
Is there a way for FileDialog's FileFilter to show only files ending in .BMP or .JPG or .PNG?
Not at the moment, as the help says "If a filename contains the text of the filter the file will be displayed". I might revisit this sometime soon as it would be a nice addition.

prevent the user from entering a file name that doesn't exist.
I'll think about if I do any changes in future.
 

kkolle

Member
Licensed User
Longtime User
Hi Agraham!

Is it possible to set the title in a TimeDialog when the user changes the time?

When you set a new alarm in the alarm clock you know what I mean (alarm_clock.png)

One more wish:
Is it possible to remove the unnecessary space in the dialogs when no message ist set (timedialog.png)?

B4X:
ret = Td.Show("", "Zeit", "", "Zurück", "Fertig", Bmp)

Thanks!!
 

Attachments

  • alarm_clock.jpg
    alarm_clock.jpg
    12.9 KB · Views: 301
  • timedialog.jpg
    timedialog.jpg
    11.1 KB · Views: 281

brainfart

Member
Licensed User
Longtime User
A way to add HTML link into CustomDialog2

Hello.
Can someone advise if there is 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 link.

Thanks
 

moster67

Expert
Licensed User
Longtime User
I am not sure if it works in the dialog-library but you can try the "linkify"-object using Agraham's reflection-library. I believe Agraham was so kind to even include a demo how to use "linkify". :)


Hello.
Can someone advise if there is 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 link.

Thanks



Inviato dal mio Nexus One usando Tapatalk
 
Last edited:

thedesolatesoul

Expert
Licensed User
Longtime User
Are customdialogs based on the dialogs from the Android SDK here:Creating Dialogs | Android Developers

I ask, because I want to port some dialogs (for eg progress dialog) but I remember reading somewhere that modality is not supported in Java, and B4A implements its own kind of modality for msgbox etc.
 
Status
Not open for further replies.
Top