# BaseTransientBottomBar.BaseCallback

[View Source](https://github.com/material-components/material-components-android/blob/1.14.0/lib/java/com/google/android/material/snackbar/BaseTransientBottomBar.java)

*** ** * ** ***


```
public abstract class BaseTransientBottomBar.BaseCallback<B>
```

<br />

Known direct subclasses [Snackbar.Callback](https://developer.android.com/reference/com/google/android/material/snackbar/Snackbar.Callback)

|---|---|
| `https://developer.android.com/reference/com/google/android/material/snackbar/Snackbar.Callback` | Callback class for `https://developer.android.com/reference/com/google/android/material/snackbar/Snackbar` instances. |

*** ** * ** ***

Base class for `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar` callbacks.

| Parameters |
|---|---|
| `<B>` | The transient bottom bar subclass. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar#addCallback(com.google.android.material.snackbar.BaseTransientBottomBar.BaseCallback<B>)` |   |

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_ACTION() = 1` Indicates that the Snackbar was dismissed via an action click. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_CONSECUTIVE() = 4` Indicates that the Snackbar was dismissed from a new Snackbar being shown. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_MANUAL() = 3` Indicates that the Snackbar was dismissed via a call to `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar#dismiss()`. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_SWIPE() = 0` Indicates that the Snackbar was dismissed via a swipe. |
| `static final int` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_TIMEOUT() = 2` Indicates that the Snackbar was dismissed via a timeout. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#BaseCallback()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#onDismissed(B,int)(B transientBottomBar, int event)` Called when the given `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar` has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked. |
| `void` | `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#onShown(B)(B transientBottomBar)` Called when the given `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar` is visible. |

## Constants

### DISMISS_EVENT_ACTION

```
public static final int DISMISS_EVENT_ACTION = 1
```

Indicates that the Snackbar was dismissed via an action click.

### DISMISS_EVENT_CONSECUTIVE

```
public static final int DISMISS_EVENT_CONSECUTIVE = 4
```

Indicates that the Snackbar was dismissed from a new Snackbar being shown.

### DISMISS_EVENT_MANUAL

```
public static final int DISMISS_EVENT_MANUAL = 3
```

Indicates that the Snackbar was dismissed via a call to `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar#dismiss()`.

### DISMISS_EVENT_SWIPE

```
public static final int DISMISS_EVENT_SWIPE = 0
```

Indicates that the Snackbar was dismissed via a swipe.

### DISMISS_EVENT_TIMEOUT

```
public static final int DISMISS_EVENT_TIMEOUT = 2
```

Indicates that the Snackbar was dismissed via a timeout.

## Public constructors

### BaseCallback

```
public BaseCallback()
```

## Public methods

### onDismissed

```
public void onDismissed(B transientBottomBar, int event)
```

Called when the given `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar` has been dismissed, either through a time-out, having been manually dismissed, or an action being clicked.

| Parameters |
|---|---|
| `B transientBottomBar` | The transient bottom bar which has been dismissed. |
| `int event` | The event which caused the dismissal. One of either: `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_SWIPE()`, `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_ACTION()`, `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_TIMEOUT()`, `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_MANUAL()` or `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar.BaseCallback#DISMISS_EVENT_CONSECUTIVE()`. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar#dismiss()` |   |

### onShown

```
public void onShown(B transientBottomBar)
```

Called when the given `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar` is visible.

| Parameters |
|---|---|
| `B transientBottomBar` | The transient bottom bar which is now visible. |

| See also |
|---|---|
| `https://developer.android.com/reference/com/google/android/material/snackbar/BaseTransientBottomBar#show()` |   |