//app/com.fredhappyface.ewesticker.utilities/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.
| Toaster | [androidJvm] constructor(context: Context) |
| 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 |