ToastHelper

class ToastHelper(context: Context)(source)

Centralized Toast helper for Android.

Simplifies showing standard Android toasts with semantic shorthands (info, success, etc.).

Important: All calls must be made from the main (UI) thread.

Example usage:

val toastHelper = ToastHelper(context)

toastHelper.show("Copied to clipboard!", ToastStyle.Short)
toastHelper.success("Profile updated")
toastHelper.error("Connection failed")

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard
fun error(message: String)
Link copied to clipboard
fun info(message: String)
Link copied to clipboard
fun show(message: String, style: ToastStyle = ToastStyle.Short)
Link copied to clipboard
fun success(message: String)
Link copied to clipboard
fun warning(message: String)