B4X Store
ElevateUI · B4A · B4XCanvas / XUI

UITastyToast

Animated floating messages with 46 icon styles, smooth entry/exit, configurable duration, gradients and a progress bar.

Call Initialize once, then use Success, Warning, Info or any of the other 43 variants. The toast appears near the bottom, plays a B4XCanvas icon animation and dismisses after Duration.

56
Public methods
4
B4A tutorials
46
Animations
2
set/get pairs

Interactive playground

Web demonstration of look and behavior; the actual controls run in B4A Android.

ANDROID TOAST PREVIEW

Select any animation from the gallery to preview it here.

✅
Success

Datos guardados

Illustrative web icons: the Android library draws its own animations using B4XCanvas.

Step-by-step B4A tutorials

Integration examples based on the ElevateUI API. Event handlers are declared outside Activity_Create.

Example 1

Success and error notifications when saving

When to use it: Tell the user whether an operation completed.

B4A
Sub Globals
    Private Toast As UITastyToast
End Sub

Sub Activity_Create(FirstTime As Boolean)
    Toast.Initialize
    Toast.Duration = Toast.LENGTH_NORMAL
    Toast.UseGradient = True
End Sub

Private Sub ButtonSave_Click
    ' Llamar a Toast.Success después de guardar.
    Toast.Success("Datos guardados")
End Sub

Private Sub ButtonError_Click
    Toast.Error("No se pudo completar la operación")
End Sub
Example 2

Duration, gradients and progress indicator

When to use it: Timed feedback where users benefit from a visual duration indicator.

B4A
Toast.Initialize
Toast.Duration = Toast.LENGTH_LONG
Toast.UseGradient = True
Toast.ProgressVisible = True
Toast.CornerRadius = 18dip
Toast.Info("Sincronizando información")
Dim progresoActivo As Boolean = Toast.ProgressVisible
Log(progresoActivo)
Example 3

Customize the message typeface and colors

When to use it: Match messages to dark mode or your application's branding.

B4A
Toast.Initialize
Toast.CustomTypeface = Typeface.DEFAULT_BOLD
Toast.CustomBackColor = 0xFF1E293B
Toast.TextColor = Colors.White
Toast.ProgressVisible = True
Toast.Chart("Reporte generado")
Example 4

Choose a toast icon based on the operation

When to use it: Provide recognizable feedback for networking, downloads, email, and security.

B4A
' Toast.Initialize ya se ejecutó durante Activity_Create.
Toast.Sync("Sincronización completada")
Toast.Download("Archivo descargado")
Toast.Mail("Correo enviado")
Toast.ElectricMeter("Lectura del medidor registrada")
Toast.Lock("Acceso protegido")

B4X properties, fields and constants

When matching setX/getX members exist, assign and read X through property syntax.

CornerRadius

Paired set/get: read/write as .CornerRadius

Toast.CornerRadius = 18dip
Dim radio As Int = Toast.CornerRadius
setCornerRadius + getCornerRadius

ProgressVisible

Paired set/get: read/write as .ProgressVisible

Toast.ProgressVisible = True
Dim activo As Boolean = Toast.ProgressVisible
setProgressVisible + getProgressVisible

Public constants

NameValuePurpose
LENGTH_SHORT25002.5 seconds
LENGTH_NORMAL45004.5 seconds, default
LENGTH_LONG70007 seconds

Complete public API: 56 methods

Every method retains its exact declaration, explains when it is useful and provides copyable B4A code.

⚙️

Initialize

Public Sub Initialize

Use case: Initialize the toast controller once the Activity is available.

B4A
Toast.Initialize

Result: the statement performs the described action on the component.

⚙️

setUseGradient

Public Sub setUseGradient(UseGradient As Boolean)

Use case: Use a gradient instead of a solid background.

B4A
Toast.UseGradient = True

Result: the statement performs the described action on the component.

⚙️

setDuration

Public Sub setDuration(DurationType As Int)

Use case: Set how long a toast remains visible.

B4A
Toast.Duration = Toast.LENGTH_SHORT

Result: the statement performs the described action on the component.

✅

Success

Public Sub Success(Message As String)

Use case: Save and confirmation messages

B4A
Toast.Success("Datos guardados correctamente")

Result: the statement performs the described action on the component.

📶

Signal

Public Sub Signal(Message As String)

Use case: Network connection restored

B4A
Toast.Signal("Conexión recuperada")

Result: the statement performs the described action on the component.

🔋

Battery

Public Sub Battery(Message As String)

Use case: Device battery state

B4A
Toast.Battery("Batería suficiente")

Result: the statement performs the described action on the component.

💰

Money

Public Sub Money(Message As String)

Use case: Successful payment or money transfer

B4A
Toast.Money("Pago recibido")

Result: the statement performs the described action on the component.

☑️

Done

Public Sub Done(Message As String)

Use case: Completed task

B4A
Toast.Done("Proceso finalizado")

Result: the statement performs the described action on the component.

🦠

Virus

Public Sub Virus(Message As String)

Use case: Security and threat alerts

B4A
Toast.Virus("Se encontró una amenaza")

Result: the statement performs the described action on the component.

⚠️

Warning

Public Sub Warning(Message As String)

Use case: Validation or attention-required alerts

B4A
Toast.Warning("Verifica los datos")

Result: the statement performs the described action on the component.

🐈

Cat

Public Sub Cat(Message As String)

Use case: Friendly in-app greetings and gamification

B4A
Toast.Cat("¡Hola, gatito!")

Result: the statement performs the described action on the component.

🐕

Dog

Public Sub Dog(Message As String)

Use case: Playful achievement and game feedback

B4A
Toast.Dog("¡Buen trabajo!")

Result: the statement performs the described action on the component.

🐞

Bug

Public Sub Bug(Message As String)

Use case: Bug reports and debugging hints

B4A
Toast.Bug("Se detectó un error")

Result: the statement performs the described action on the component.

📦

BoxCat

Public Sub BoxCat(Message As String)

Use case: Surprise and unlock notifications

B4A
Toast.BoxCat("Nuevo contenido")

Result: the statement performs the described action on the component.

😕

Confused

Public Sub Confused(Message As String)

Use case: Ambiguous input and user guidance

B4A
Toast.Confused("No entendimos el dato")

Result: the statement performs the described action on the component.

📍

Pin

Public Sub Pin(Message As String)

Use case: Saved locations and pinned spots

B4A
Toast.Pin("Ubicación guardada")

Result: the statement performs the described action on the component.

🔥

Fire

Public Sub Fire(Message As String)

Use case: Streaks and featured activity

B4A
Toast.Fire("¡Nueva racha!")

Result: the statement performs the described action on the component.

ℹ️

Info

Public Sub Info(Message As String)

Use case: General informational alerts

B4A
Toast.Info("Información actualizada")

Result: the statement performs the described action on the component.

🔎

Search

Public Sub Search(Message As String)

Use case: Search operation results

B4A
Toast.Search("Búsqueda finalizada")

Result: the statement performs the described action on the component.

☁️

Cloud

Public Sub Cloud(Message As String)

Use case: Cloud storage status

B4A
Toast.Cloud("Datos en la nube")

Result: the statement performs the described action on the component.

⬇️

Download

Public Sub Download(Message As String)

Use case: Completed file download

B4A
Toast.Download("Descarga completada")

Result: the statement performs the described action on the component.

🪟

Windows

Public Sub Windows(Message As String)

Use case: Desktop or platform notices

B4A
Toast.Windows("Listo para Windows")

Result: the statement performs the described action on the component.

🔄

Sync

Public Sub Sync(Message As String)

Use case: Data synchronization status

B4A
Toast.Sync("Datos sincronizados")

Result: the statement performs the described action on the component.

❄️

Snow

Public Sub Snow(Message As String)

Use case: Temperature-related or themed messages

B4A
Toast.Snow("Modo invierno activado")

Result: the statement performs the described action on the component.

😐

Neutral

Public Sub Neutral(Message As String)

Use case: Neutral nonurgent feedback

B4A
Toast.Neutral("Sin cambios")

Result: the statement performs the described action on the component.

⚙️

Config

Public Sub Config(Message As String)

Use case: Settings update feedback

B4A
Toast.Config("Configuración guardada")

Result: the statement performs the described action on the component.

✉️

Mail

Public Sub Mail(Message As String)

Use case: Email sent or mailbox updates

B4A
Toast.Mail("Mensaje enviado")

Result: the statement performs the described action on the component.

📊

Chart

Public Sub Chart(Message As String)

Use case: Reports and analytics ready

B4A
Toast.Chart("Reporte generado")

Result: the statement performs the described action on the component.

🎉

Confetti

Public Sub Confetti(Message As String)

Use case: Achievements and celebrations

B4A
Toast.Confetti("¡Objetivo cumplido!")

Result: the statement performs the described action on the component.

😍

LoveFace

Public Sub LoveFace(Message As String)

Use case: Positive feedback and ratings

B4A
Toast.LoveFace("¡Nos encanta!")

Result: the statement performs the described action on the component.

❤️

Love

Public Sub Love(Message As String)

Use case: Favorites and liked content

B4A
Toast.Love("Agregado a favoritos")

Result: the statement performs the described action on the component.

😠

Angry

Public Sub Angry(Message As String)

Use case: Emotion-based surveys or playful UX

B4A
Toast.Angry("Algo salió mal")

Result: the statement performs the described action on the component.

❌

Error

Public Sub Error(Message As String)

Use case: Operational errors and failures

B4A
Toast.Error("No se pudo guardar")

Result: the statement performs the described action on the component.

🌸

Kirby

Public Sub Kirby(Message As String)

Use case: Playful game notifications

B4A
Toast.Kirby("¡Nueva sorpresa!")

Result: the statement performs the described action on the component.

🎂

Cake

Public Sub Cake(Message As String)

Use case: Birthdays and celebrations

B4A
Toast.Cake("¡Feliz cumpleaños!")

Result: the statement performs the described action on the component.

🔔

Bell

Public Sub Bell(Message As String)

Use case: Reminders and announcements

B4A
Toast.Bell("Tienes un aviso")

Result: the statement performs the described action on the component.

⭐

Star

Public Sub Star(Message As String)

Use case: Ratings, favorites and achievements

B4A
Toast.Star("Has ganado una estrella")

Result: the statement performs the described action on the component.

🌻

Sunflower

Public Sub Sunflower(Message As String)

Use case: Positive well-being and themed messages

B4A
Toast.Sunflower("¡Buen día!")

Result: the statement performs the described action on the component.

🎁

Gift

Public Sub Gift(Message As String)

Use case: Rewards and promotions

B4A
Toast.Gift("Premio disponible")

Result: the statement performs the described action on the component.

⚡

ElectricMeter

Public Sub ElectricMeter(Message As String)

Use case: Electrical meter readings and energy

B4A
Toast.ElectricMeter("Lectura registrada")

Result: the statement performs the described action on the component.

💡

Bulb

Public Sub Bulb(Message As String)

Use case: Tips and inspiration

B4A
Toast.Bulb("Nueva recomendación")

Result: the statement performs the described action on the component.

👻

Ghost

Public Sub Ghost(Message As String)

Use case: Games and seasonal events

B4A
Toast.Ghost("¡Buu!")

Result: the statement performs the described action on the component.

🌈

Rainbow

Public Sub Rainbow(Message As String)

Use case: Theme and milestone celebrations

B4A
Toast.Rainbow("Nuevo tema disponible")

Result: the statement performs the described action on the component.

📵

NoSignal

Public Sub NoSignal(Message As String)

Use case: Lost connectivity feedback

B4A
Toast.NoSignal("Sin conexión")

Result: the statement performs the described action on the component.

🎲

Dice

Public Sub Dice(Message As String)

Use case: Randomized game events

B4A
Toast.Dice("Lanza los dados")

Result: the statement performs the described action on the component.

🚀

Rocket

Public Sub Rocket(Message As String)

Use case: Launches and feature announcements

B4A
Toast.Rocket("¡Despegamos!")

Result: the statement performs the described action on the component.

🔒

Lock

Public Sub Lock(Message As String)

Use case: Secure access and privacy status

B4A
Toast.Lock("Sesión protegida")

Result: the statement performs the described action on the component.

😢

Sad

Public Sub Sad(Message As String)

Use case: Disappointing outcomes

B4A
Toast.Sad("Inténtalo otra vez")

Result: the statement performs the described action on the component.

📁

FileAction

Public Sub FileAction(Message As String)

Use case: File actions and document handling

B4A
Toast.FileAction("Archivo creado")

Result: the statement performs the described action on the component.

⚙️

setCornerRadius

Public Sub setCornerRadius(Radius As Int)

Use case: Set the notification corner radius.

B4A
Toast.CornerRadius = 18dip

Result: the statement performs the described action on the component.

⚙️

getCornerRadius

Public Sub getCornerRadius As Int

Use case: Read the configured corner radius.

B4A
Dim radio As Int = Toast.CornerRadius

Result: the statement performs the described action on the component.

⚙️

setProgressVisible

Public Sub setProgressVisible(Visible As Boolean)

Use case: Display a time-remaining progress indicator.

B4A
Toast.ProgressVisible = True

Result: the statement performs the described action on the component.

⚙️

getProgressVisible

Public Sub getProgressVisible As Boolean

Use case: Check if the progress indicator is enabled.

B4A
Dim mostrar As Boolean = Toast.ProgressVisible

Result: the statement performs the described action on the component.

⚙️

setCustomTypeface

Public Sub setCustomTypeface(tf As Typeface)

Use case: Set a custom message font.

B4A
Toast.CustomTypeface = Typeface.DEFAULT_BOLD

Result: the statement performs the described action on the component.

⚙️

setCustomBackColor

Public Sub setCustomBackColor(Color As Int)

Use case: Apply a custom ARGB background color.

B4A
Toast.CustomBackColor = 0xFF1E293B

Result: the statement performs the described action on the component.

⚙️

setTextColor

Public Sub setTextColor(Clr As Int)

Use case: Customize the message text color.

B4A
Toast.TextColor = Colors.White

Result: the statement performs the described action on the component.