Toast

toast

Toast notifications are small messages, based on user actions. It can be used to provide feedback about an operation or to display a system message.

Usage

toast

XelaToast(
    title = "New version available",
    description = "A new Version of software is available for download",
    rightButtonIcon = R.drawable.ic_x,
    firstActionButtonText = "Update",
    secondActionButtonText = "Not now",
    background = XelaColor.Gray3,
    titleColor = Color.White,
    firstActionButtonColor = XelaColor.Green5,
    secondActionButtonColor = Color.White,
    rightButtonIconColor = Color.White,
    descriptionColor = Color.White,
    iconColor = Color.White,
)

Properties

Name Type Default Value Required Description
title String - YES Toast title string
description String NO Toast description string
icon Int? null NO Toast icon name from Drawable
avatar (@Composable () -> Unit)? null NO Avatar for toast
rightButtonIcon Int? null NO Right button for toast
firstActionButtonText String? null NO First action text
secondActionButtonText String? null NO Second action text
onFirstButtonAction (()->Unit)? null NO Func for first button action
onSecondButtonAction (()->Unit)? null NO Func for second button action
onRightButtonAction (()->Unit)? null NO Func for right button action
autoresize Boolean false NO Autoresize width for toast
background Color Color.White NO Toast background color
firstActionButtonColor Color XelaColor.Blue3 NO First action color
secondActionButtonColor Color XelaColor.Blue3 NO Second action color
titleColor Color XelaColor.Gray2 NO Title text color
descriptionColor Color XelaColor.Gray6 NO Description text color
iconColor Color XelaColor.Blue3 NO Icon color
rightButtonIconColor Color XelaColor.Gray2 NO Right Button Icon color