public abstract static class Snackbar.Callback extends Object
Snackbar
instances.Snackbar.setCallback(Callback)
Modifier and Type | Class and Description |
---|---|
static interface |
Snackbar.Callback.DismissEvent |
Modifier and Type | Field and Description |
---|---|
static int |
DISMISS_EVENT_ACTION
Indicates that the Snackbar was dismissed via an action click.
|
static int |
DISMISS_EVENT_CONSECUTIVE
Indicates that the Snackbar was dismissed from a new Snackbar being shown.
|
static int |
DISMISS_EVENT_MANUAL
Indicates that the Snackbar was dismissed via a call to
Snackbar.dismiss() . |
static int |
DISMISS_EVENT_SWIPE
Indicates that the Snackbar was dismissed via a swipe.
|
static int |
DISMISS_EVENT_TIMEOUT
Indicates that the Snackbar was dismissed via a timeout.
|
Constructor and Description |
---|
Callback() |
Modifier and Type | Method and Description |
---|---|
void |
onDismissed(Snackbar snackbar,
int event)
Called when the given
Snackbar has been dismissed, either through a time-out,
having been manually dismissed, or an action being clicked. |
void |
onShown(Snackbar snackbar)
Called when the given
Snackbar is visible. |
public static final int DISMISS_EVENT_SWIPE
public static final int DISMISS_EVENT_ACTION
public static final int DISMISS_EVENT_TIMEOUT
public static final int DISMISS_EVENT_MANUAL
Snackbar.dismiss()
.public static final int DISMISS_EVENT_CONSECUTIVE
public void onDismissed(Snackbar snackbar, int event)
Snackbar
has been dismissed, either through a time-out,
having been manually dismissed, or an action being clicked.snackbar
- The snackbar which has been dismissed.event
- The event which caused the dismissal. One of either:
DISMISS_EVENT_SWIPE
, DISMISS_EVENT_ACTION
,
DISMISS_EVENT_TIMEOUT
, DISMISS_EVENT_MANUAL
or
DISMISS_EVENT_CONSECUTIVE
.Snackbar.dismiss()
public void onShown(Snackbar snackbar)
Snackbar
is visible.snackbar
- The snackbar which is now visible.Snackbar.show()