Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 1.74 KB

File metadata and controls

22 lines (15 loc) · 1.74 KB

//app/com.fredhappyface.ewesticker.utilities/Toaster

Toaster

[androidJvm]
class Toaster(context: Context)

The Toaster class provides a simplified interface to android.widget.Toast. Pass in the android.content.Context to the constructor and call the 'toast' function (others as below) toaster.state keeps track of an error state or similar.

Constructors

Toaster [androidJvm]
constructor(context: Context)

Functions

Name Summary
setState [androidJvm]
fun setState(state: Int)
Set the state to some integer value
toast [androidJvm]
fun toast(string: String)
Call toaster.toast with some string to always create a toast notification. Context is set when Toaster is instantiated. Duration is determined based on text length
toastOnState [androidJvm]
fun toastOnState(strings: Array<String>)
Call toaster.toastOnState with an array of messages to create a toast notification. Context is set when Toaster is instantiated. Duration is determined based on text length. The message is selected based on the state (which can be set in a callback function or elsewhere