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

Create a dialog with titles, messages and icons.

This dialog can include a title, a message, an icon, and an "OK" button that closes the dialog. It also allows you to customize the background, text, and border colors, as well as the corner radius.

20241011_021221


Update:

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



Function:

ShowAlertDialog

  • title (String): This can include HTML.
  • message (String): This can also include HTML.
  • iconData (String): Which can be a filename in the Assets storage.
  • dialogColor (int): Background color of the dialog.
  • backgroundColor (int): Background color of the dialog content.
  • cornerRadius (float): Value that sets the corner radius of the dialog's background.
  • titleColor (int).
  • titleSize (float).
  • messageColor (int).
  • messageSize (float).

AddButtons

  • buttonIDs: List of IDs for the buttons.
  • buttonTexts: List of texts for the buttons.
  • buttonColors: List of background colors for the buttons.
  • buttonTextColors: List of text colors for the buttons.
  • buttonTextSizes: List of text sizes for the buttons.
  • buttonBorderColors: List of border colors for the buttons.
  • buttonBorderWidths: List of border widths for the buttons.
  • buttonWidths: List of widths for the buttons.
  • buttonHeights: List of heights for the buttons.
  • buttonCornerRadius: List of corner radii for the buttons.
  • buttonIcons: List of icon file names for buttons.
  • iconSizes: List of icon sizes.
  • iconPositions: List of icon positions.
  • buttonSpacing (int): Spacing between buttons.
  • bottomPadding (int): Padding at the bottom of the button container.

component_method (6)

Dismiss

  • Closes the AlertDialog.

Event:

component_event (11)

ButtonClicked

  • buttonID: Identifier of the button that was clicked.
  • buttonText: Text of the button that was clicked.
  • buttonIndex: Index of the button that was clicked.

Extension:
joejsanz.joedevalertdialog.aix (12.2 KB)


Thanks.

11 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.

1 Like