B4A Library [Lib] BetterDialogs

I tried to improve the most useful dialogs of the Dialogs library. In my version, HTML tags are interpreted (even in the text of buttons), the InputBox uses a Masked EditText and has more options, you can check if the input is valid before closing the dialog, and the CustomDialog is fully customizable. I also solved an issue with the virtual keyboard.

MsgBox (under Gingerbread and JellyBean):

msgbox.png


InputBox (under Gingerbread and JellyBean):

inputbox.png


CustomDialog (under Gingerbread and JellyBean):

cd1.jpg


Another CustomDialog (under Gingerbread and JellyBean):

cd2.png


v1.1:
- I added a CloseDialog function;
- I added a margin parameter to the custom dialog.

v1.2:
- I fixed a bug in InputBox when there's a default value;
- I added the BackKeyPressed event for custom dialogs.

v1.3:
- I added a PasswordMode option to the InputBox;
- I added a CancelOnTouchOutside option.

v1.4:
- I added a CursorPosition option to the InputBox.

v2.0:
- I moved the CustomDialog parameters to the BD_CustomDlgParams class.
- I added two new parameters: Duration and DialogGravity.
- I removed the Margin parameter and added the MarginHeight parameter (to be used when Gravity is set to TOP).
- The BodyWidth and BodyHeight parameters defines now accurately the size of the dialog body.

v2.1:
- I added a "closing" event raised just before a custom dialog is dismissed. You can cancel the closure by returning False.

v2.11:
- I added the "DlgResponse" parameter to the Closing event.

This library does not work with Android versions < 2.
It requires another library: Masked EditText
 

Attachments

  • BetterDialogs v2.11.zip
    55.6 KB · Views: 2,235
  • Java source - BetterDialogs.zip
    8.5 KB · Views: 666
Last edited:

GiulioVale

Active Member
Licensed User
Longtime User
Uhm ok. Only for info is correct so have screen like attached?
 

Attachments

  • screen.png
    screen.png
    25.3 KB · Views: 260

pfillion

Member
Licensed User
Longtime User
Is there a way to change the font size within the html text ?

I tried <font size=n></font> but it did not work. I want to make my text smaller...

Thanks
 

pfillion

Member
Licensed User
Longtime User
You can change the size with <H1></H1> to <H6></H6>

It's not precise enough... Good if you have header and text but not if you want to have the body of your text at a specific size... Why isn't the font attribute available either as a tag or withing a style in the <p> tag ?
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
It's not precise enough... Good if you have header and text but not if you want to have the body of your text at a specific size... Why isn't the font attribute available either as a tag or withing a style in the <p> tag ?
1) It's better than nothing, and "nothing" was the previous situation.
2) The API function to interpret the HTML tags is supposed to handle the font size. I don't know why it is not properly interpreted. Ask to Google.
3) You can create a custom dialog with a webview inside so it's not really an issue.
 
Last edited:

pfillion

Member
Licensed User
Longtime User
1) It's better than nothing, and "nothing" was the previous situation.
2) The API function to interpret the HTML tags is supposed to handle the font size. I don't know why it is not properly interpreted. Ask to Google.
2) You can create a custom dialog with a webview inside so it's not really an issue.
Ok thanks.
 

TheMightySwe

Active Member
Licensed User
Longtime User
Hi,

Is there a way to get the cursor to be on the first position when using a masked text input instead of the last?

Regards, J
 
Top