Snackbar
SESL variant Snackbars provide lightweight feedback about an operation. They show a brief message at the bottom of the screen on mobile and lower left on larger devices. Snackbars appear above all other elements on screen and only one can be displayed at a time.
Snackbars can contain an action which is set via setAction.
Snackbars automatically disappear after a timeout. They can also be dismissed by being swiped off screen, by action click, from a new snackbar being displayed, or manually via a call to dismiss.
To be notified when a snackbar has been shown or dismissed, you can provide a Callback via addCallback.
For more information, see the component developer guidance and design guidelines.
Types
Link copied to clipboard
Callback class for Snackbar instances.
Link copied to clipboard
Link copied to clipboard
Properties
Functions
Link copied to clipboard
Dismiss the BaseTransientBottomBar.
Link copied to clipboard
Return the duration.
Link copied to clipboard
Link copied to clipboard
Return whether this BaseTransientBottomBar is currently being shown.
Link copied to clipboard
Make a Snackbar to display a message.
open fun make(@NonNull context: Context, @NonNull view: View, @NonNull text: CharSequence, duration: Int): Snackbar
open fun make(@NonNull context: Context, @NonNull view: View, @NonNull text: CharSequence, duration: Int, type: Int): Snackbar
Make a Snackbar to display a message Snackbar will try and find a parent view to hold Snackbar's view from the value given to
view
.Link copied to clipboard
@CanIgnoreReturnValue
@CanIgnoreReturnValue
Set the action to be displayed in this BaseTransientBottomBar.
Link copied to clipboard
Sets the text color of the action specified in setAction.
Link copied to clipboard
Sets the tint color of the background Drawable.
Link copied to clipboard
@CanIgnoreReturnValue
Sets the tint color state list of the background Drawable.
Link copied to clipboard
Link copied to clipboard
Set a callback to be called when this the visibility of this Snackbar changes.
Link copied to clipboard
Sets the max width of the action to be in the same line as the message.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Show the BaseTransientBottomBar.