Toast - Custom Toast: Position, background & text color, size, radius, HTML text & icon

Toast
Custom Toast: Position, background & text color, size, radius, HTML text & icon.

GIF_20250412_045334_427

Try the aia project so you can see it more clearly.


ToastProperties

Configure custom properties for a Toast.


TextPadding

Sets the text padding for a Toast.

blocks - 2025-04-12T045528.646


IconProperties

Set the icon size and padding (values in dp).

blocks - 2025-04-12T045538.279


SetIcon

Set an icon from the assets and the position (Left or Right).


ShowToast

Displays the custom Toast.

You can use this function alone and the toast will be displayed with its default values ​​and without an icon.

Default Values

ToastProperties

  • textColor = White
    backgroundColor = DarkGray
    cornerRadius = 20
    textSize = 16
    duration = Short
    position = Bottom

TextPadding

  • left = 30
    top = 16
    right = 30
    bottom = 16

ToastShown

Fires when a Toast is displayed.

component_event (48)


Update v1.1 April 12, 2025.

  • The app icon no longer appears on Android 12+
  • SetShortToast and SetLongShort have been merged into a single function called ShowToast.
  • Added functions to control text padding, background and text colors, toast position, and adding an icon from assets.
  • Added the ability to embed HTML in text.

Toast.aia (33.6 KB)

joejsanz.joedevtoast.aix (13.2 KB)


JDK: 11
Minimum API Level: 21
Updated On: 2025-04-12T07:00:00Z

Built using: FAST-CLI v2.8.4


Thanks.

6 Likes

Thank you very much for sharing! very good work

1 Like

Thank You so much @Gabriel_Egea

Update v1.1 April 12, 2025.

3 Likes

means ?

The use of the extension allows the developer to NOT display an icon, which Android insisted on from Android 12.