AlertDialog - Custom Dialog -Title & Message (html) • Color • Radius, Icons & Buttons

AlertDialog
Includes: title, message, icon (Static or Animated), customizable buttons, background colors, text, border, corner radius.

GIF_20250614_024902_710

20241011_021221



Update v1.1 June 14, 2025.

  • Icons can now be added from assets or URLs from the web: .jpg, .png, .gif
  • A helper block has been added for imagePositions.
  • The backgroundColor parameter has been removed from the ShowAlertDialog function; the block will update.
  • The IconSize function has been added.
  • A click effect and shadow have been added to buttons.
    (When the effect ends, the dialog closes, triggering the event.)
  • Three new parameters have been added to the AddButtons function.

ShowAlertDialog

Shows an AlertDialog with an icon or animated gif

The backgroundColor parameter has been removed as it was no longer needed. (The block will be updated).

You can add image from assets or url.
Formats: .jpg, .png y .gif.


IconSize

Changes the size of the icon.

blocks (16)

The size is 400 x 400 by default.

  • You can enter any value to resize the icon within the dialog.

AddButtons

Adds multiple buttons below the message with customizable options.

3 more parameters have been added, the block will be updated.

Parameters: buttonGravity , shadowElevation , shadowColors .

Customizable Options:

  • Change the color.

  • Separate corner radius.

  • Height and width.

  • Add icons.

  • Position icons between left, right, top, and bottom.

  • Shadow under the button and change its color.

  • buttonGravity: Positions buttons to the right, center, or left.

  • shadowElevation: The distance of the shadow under the button. (The shadow has no feathering.)

  • shadowColors: The shadow color. It is recommended that colors with transparency be used. Enter a hexadecimal value, for example: #22000000 (22 indicates transparency).

  • In buttonWidths if you pass -1 as the value, the button will expand to cover the available space.


Dismiss

Closes the AlertDialog.

component_method (5)


ButtonClicked

Triggered when a button is clicked.

component_event (4)

It will fire after the button completes the click animation.


v1.1 June 14, 2025.

AlertDialog.aia (532.3 KB)

joejsanz.joedevalertdialog.aix (19.7 KB)


JDK: 11
Minimum API Level: 21
Updated On: 2025-06-14T07:00:00Z

Built using: FAST-CLI v3.6.1


Thanks.

13 Likes

Very nice, could you add an After event, and maybe CANCEL & OK, instead of a X?

1 Like

Thank you Tim.

The x can be removed by leaving the parameter empty.
As for the cancel and accept buttons, they can be placed at the bottom, the function to add configurable buttons and an event is already done, but I have not updated the post yet.

While I show you some screenshots:

component_event (10)

2 Likes

Update:

Integration of buttons, an event for the buttons and a function to close the dialog.

2 Likes

Exactly what I needed!

How and why do you make the best extensions?!

1 Like

Thanks a lot aimbot_user

How? I search a lot, sometimes I hit a wall, but I like to create and I like my applications to look good, like everyone else I suppose.

There are more users who have made excellent extensions.
But I thank you.


Screenshot 2025-01-07 at 4.38.21 AM
This is something that I could not have made without your amazing extension, and the most important are yours. Even though I am using other extensions, you have made extensions that do the same thing, but I discovered them after finding the original, or had problems uploading them to Kodular. But nevertheless, I would always prefer your extension over most, as you make it so much easier to make my apps as good as this!

EDIT: DaffyDialog could be replaced by your AlertDialog, but they both are used in different ways in my app

Phase could have been replaced by Lottie, but I had lost all my extensions that I previously downloaded because my computer hard reset. Anyways, I saw Phase first when searching for animations, and had forgot about Lottie (I had used it a few months prior).

MakeViewUp was to stylize the texboxes, but your TextboxCustom extension was not loading into Kodular, and I had also used this extension before I moved to
Kodular.

Also I did not use the Beautify extension, so it doesn't count :slight_smile:

All in all, 3/8 extensions I use are yours, and if I had them earlier, it would've been close to 6/8

Thank you for all the help you gave me, and the community.

2 Likes

Your app looks great.

Thanks a lot for motivating me.
You help us become better developers when you use and comment on our extensions. So we can give you something better.

3 Likes

Thanks, it looks a good extension.
I'm trying to involve it in an app.

What could be wrong?

AlertDialog displays in a narrow window, hiding all text (both in Companion and apk).
Can I set dimensions of the window?


Thank you for your advice.

I've tried it, and the same thing isn't happening to me. Could you give me more details? I've updated the extension. Try this project to see if the error persists:

Update v1.1 June 14, 2025.

It works perfectly.

Tried in a sample program, I got this

while using your aia file, no problem too.

Thank you for your kind reply and the sample code.