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

SnackbarDuration

public enum SnackbarDuration extends Enum

java.lang.Object
   ↳ kotlin.Enum
     ↳ androidx.compose.material3.SnackbarDuration

Possible durations of the Snackbar in SnackbarHost

Summary

Enum Values

Indefinite

Show the Snackbar indefinitely until explicitly dismissed or action is clicked

Long

Show the Snackbar for a long period of time

Short

Show the Snackbar for a short period of time

Public methods

final @NonNull EnumEntries<@NonNull SnackbarDuration>

Possible durations of the Snackbar in SnackbarHost

final @NonNull SnackbarDuration

Returns the enum constant of this type with the specified name.

final @NonNull SnackbarDuration[]

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

Indefinite

SnackbarDuration SnackbarDuration.Indefinite

Show the Snackbar indefinitely until explicitly dismissed or action is clicked

Long

SnackbarDuration SnackbarDuration.Long

Show the Snackbar for a long period of time

Short

SnackbarDuration SnackbarDuration.Short

Show the Snackbar for a short period of time

Public methods

getEntries

public final @NonNull EnumEntries<@NonNull SnackbarDurationgetEntries()

Possible durations of the Snackbar in SnackbarHost

valueOf

public final @NonNull SnackbarDuration valueOf(@NonNull String value)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

public final @NonNull SnackbarDuration[] values()

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.