{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SnackbarVisuals

public interface SnackbarVisuals


Interface to represent the visuals of one particular Snackbar as a piece of the SnackbarData.

Summary

Public methods

abstract String

optional action label to show as button in the Snackbar

abstract @NonNull SnackbarDuration

duration of the Snackbar

abstract @NonNull String

text to be shown in the Snackbar

abstract boolean

a boolean to show a dismiss action in the Snackbar.

Public methods

getActionLabel

abstract String getActionLabel()

optional action label to show as button in the Snackbar

getDuration

abstract @NonNull SnackbarDuration getDuration()

duration of the Snackbar

getMessage

abstract @NonNull String getMessage()

text to be shown in the Snackbar

getWithDismissAction

abstract boolean getWithDismissAction()

a boolean to show a dismiss action in the Snackbar. This is recommended to be set to true better accessibility when a Snackbar is set with a SnackbarDuration.Indefinite