# BaseTransientBottomBar

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  
belongs to Maven artifact com.android.support:design:27.1.0  
Summary:[Nested Classes](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#nestedclasses)\|[Constants](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#constants)\|[Protected Ctors](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#proctors)\|[Methods](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#)  

# BaseTransientBottomBar

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public


abstract
class
BaseTransientBottomBar
`  
`

extends Object


``


`

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| java.lang.Object                                                                                                                                                                                                              ||
| ↳ | android.support.design.widget.BaseTransientBottomBar\<B extends[android.support.design.widget.BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)\<B\>\> |

|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#)Known Direct Subclasses [Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar) |--------------------------------------------------------------------------------------------|------------------------------------------------------------| | [Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar) | Snackbars provide lightweight feedback about an operation. | |

<br />

*** ** * ** ***

Base class for lightweight transient bars that are displayed along the bottom edge of the application window.

## Summary

|                                                                                                                                                 ### Nested classes                                                                                                                                                 ||
|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class`     | [BaseTransientBottomBar.BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)`<B>` Base class for[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)callbacks. |
| ` interface` | [BaseTransientBottomBar.ContentViewCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.ContentViewCallback) Interface that defines the behavior of the main content of a transient bottom bar.                                                    |

|                                                                                 ### Constants                                                                                  ||
|-------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [LENGTH_INDEFINITE](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#LENGTH_INDEFINITE) Show the Snackbar indefinitely.     |
| `int` | [LENGTH_LONG](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#LENGTH_LONG) Show the Snackbar for a long period of time.    |
| `int` | [LENGTH_SHORT](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#LENGTH_SHORT) Show the Snackbar for a short period of time. |

|                                                                                                                                                                                                                                                                                                                                ### Protected constructors                                                                                                                                                                                                                                                                                                                                ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#BaseTransientBottomBar(android.view.ViewGroup, android.view.View, android.support.design.widget.BaseTransientBottomBar.ContentViewCallback))`(`[ViewGroup](https://developer.android.com/reference/android/view/ViewGroup.html)` parent, `[View](https://developer.android.com/reference/android/view/View.html)` content, `[BaseTransientBottomBar.ContentViewCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.ContentViewCallback)` contentViewCallback) ` Constructor for the transient bottom bar. |

|                                                                                                                                                                                                                                                                   ### Public methods                                                                                                                                                                                                                                                                   ||
|------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` B`                                                                               | ` `[addCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#addCallback(android.support.design.widget.BaseTransientBottomBar.BaseCallback<B>))`(`[BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)`<B> callback) ` Adds the specified callback to the list of callbacks that will be notified of transient bottom bar events.            |
| ` void`                                                                            | ` `[dismiss](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#dismiss())`() ` Dismiss the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar).                                                                                                                                                                                                       |
| ` `[Context](https://developer.android.com/reference/android/content/Context.html) | ` `[getContext](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#getContext())`() ` Returns the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)'s context.                                                                                                                                                                                       |
| ` int`                                                                             | ` `[getDuration](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#getDuration())`() ` Return the duration.                                                                                                                                                                                                                                                                                                             |
| ` `[View](https://developer.android.com/reference/android/view/View.html)          | ` `[getView](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#getView())`() ` Returns the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)'s view.                                                                                                                                                                                                |
| ` boolean`                                                                         | ` `[isShown](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#isShown())`() ` Return whether this[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is currently being shown.                                                                                                                                                                       |
| ` boolean`                                                                         | ` `[isShownOrQueued](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#isShownOrQueued())`() ` Returns whether this[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is currently being shown, or is queued to be shown next.                                                                                                                       |
| ` B`                                                                               | ` `[removeCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#removeCallback(android.support.design.widget.BaseTransientBottomBar.BaseCallback<B>))`(`[BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)`<B> callback) ` Removes the specified callback from the list of callbacks that will be notified of transient bottom bar events. |
| ` B`                                                                               | ` `[setDuration](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#setDuration(int))`(int duration) ` Set how long to show the view for.                                                                                                                                                                                                                                                                                |
| ` void`                                                                            | ` `[show](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#show())`() ` Show the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar).                                                                                                                                                                                                                |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#)From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Constants

### LENGTH_INDEFINITE

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int LENGTH_INDEFINITE
```

Show the Snackbar indefinitely. This means that the Snackbar will be displayed from the time that is[shown](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#show())until either it is dismissed, or another Snackbar is shown.

<br />

**See also:**

- [setDuration(int)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#setDuration(int))

Constant Value: -2 (0xfffffffe)  

### LENGTH_LONG

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int LENGTH_LONG
```

Show the Snackbar for a long period of time.

<br />

**See also:**

- [setDuration(int)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#setDuration(int))

Constant Value: 0 (0x00000000)  

### LENGTH_SHORT

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int LENGTH_SHORT
```

Show the Snackbar for a short period of time.

<br />

**See also:**

- [setDuration(int)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#setDuration(int))

Constant Value: -1 (0xffffffff)

## Protected constructors

### BaseTransientBottomBar

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
BaseTransientBottomBar (ViewGroup parent, 
                View content, 
                BaseTransientBottomBar.ContentViewCallback contentViewCallback)
```

Constructor for the transient bottom bar.

<br />

|                                                              Parameters                                                              ||
|-----------------------|---------------------------------------------------------------------------------------------------------------|
| `parent`              | `ViewGroup`: The parent for this transient bottom bar. <br />                                                 |
| `content`             | `View`: The content view for this transient bottom bar. <br />                                                |
| `contentViewCallback` | `BaseTransientBottomBar.ContentViewCallback`: The content view callback for this transient bottom bar. <br /> |

## Public methods

### addCallback

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
B addCallback (BaseCallback<B> callback)
```

Adds the specified callback to the list of callbacks that will be notified of transient bottom bar events.

<br />

|                                          Parameters                                           ||
|------------|-----------------------------------------------------------------------------------|
| `callback` | `BaseCallback`: Callback to notify when transient bottom bar events occur. <br /> |

|   Returns   ||
|-----|--------|
| `B` | <br /> |

**See also:**

- [removeCallback(BaseCallback)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#removeCallback(android.support.design.widget.BaseTransientBottomBar.BaseCallback<B>))  

### dismiss

added in[version 22.2.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void dismiss ()
```

Dismiss the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar).

<br />

### getContext

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
Context getContext ()
```

Returns the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)'s context.

<br />

|                                         Returns                                         ||
|---------------------------------------------------------------------------------|--------|
| [Context](https://developer.android.com/reference/android/content/Context.html) | <br /> |

### getDuration

added in[version 22.2.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
int getDuration ()
```

Return the duration.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

**See also:**

- [setDuration(int)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#setDuration(int))  

### getView

added in[version 22.2.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
View getView ()
```

Returns the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)'s view.

<br />

|                                    Returns                                     ||
|------------------------------------------------------------------------|--------|
| [View](https://developer.android.com/reference/android/view/View.html) | <br /> |

### isShown

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isShown ()
```

Return whether this[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is currently being shown.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### isShownOrQueued

added in[version 23.4.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
boolean isShownOrQueued ()
```

Returns whether this[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)is currently being shown, or is queued to be shown next.

<br />

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### removeCallback

added in[version 26.1.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
B removeCallback (BaseCallback<B> callback)
```

Removes the specified callback from the list of callbacks that will be notified of transient bottom bar events.

<br />

|                                                Parameters                                                ||
|------------|----------------------------------------------------------------------------------------------|
| `callback` | `BaseCallback`: Callback to remove from being notified of transient bottom bar events <br /> |

|   Returns   ||
|-----|--------|
| `B` | <br /> |

**See also:**

- [addCallback(BaseCallback)](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#addCallback(android.support.design.widget.BaseTransientBottomBar.BaseCallback<B>))  

### setDuration

added in[version 22.2.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
B setDuration (int duration)
```

Set how long to show the view for.

<br />

|                                                                                                                                                                         Parameters                                                                                                                                                                         ||
|------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `duration` | `int`: either be one of the predefined lengths:[LENGTH_SHORT](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#LENGTH_SHORT),[LENGTH_LONG](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar#LENGTH_LONG), or a custom duration in milliseconds. <br /> |

|   Returns   ||
|-----|--------|
| `B` | <br /> |

### show

added in[version 22.2.0](https://developer.android.com/topic/libraries/support-library/revisions)  

```
void show ()
```

Show the[BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar).

<br />

-

  ## Annotations

  - [CoordinatorLayout.DefaultBehavior](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.DefaultBehavior)
-

  ## Interfaces

  - [AppBarLayout.OnOffsetChangedListener](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.OnOffsetChangedListener)
  - [BaseTransientBottomBar.ContentViewCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.ContentViewCallback)
  - [BottomNavigationView.OnNavigationItemReselectedListener](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView.OnNavigationItemReselectedListener)
  - [BottomNavigationView.OnNavigationItemSelectedListener](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView.OnNavigationItemSelectedListener)
  - [CoordinatorLayout.AttachedBehavior](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.AttachedBehavior)
  - [NavigationView.OnNavigationItemSelectedListener](https://developer.android.com/reference/android/support/design/widget/NavigationView.OnNavigationItemSelectedListener)
  - [SwipeDismissBehavior.OnDismissListener](https://developer.android.com/reference/android/support/design/widget/SwipeDismissBehavior.OnDismissListener)
  - [TabLayout.OnTabSelectedListener](https://developer.android.com/reference/android/support/design/widget/TabLayout.OnTabSelectedListener)
-

  ## Classes

  - [AppBarLayout](https://developer.android.com/reference/android/support/design/widget/AppBarLayout)
  - [AppBarLayout.Behavior](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior)
  - [AppBarLayout.Behavior.DragCallback](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior.DragCallback)
  - [AppBarLayout.Behavior.SavedState](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.Behavior.SavedState)
  - [AppBarLayout.LayoutParams](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.LayoutParams)
  - [AppBarLayout.ScrollingViewBehavior](https://developer.android.com/reference/android/support/design/widget/AppBarLayout.ScrollingViewBehavior)
  - [BaseTransientBottomBar](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar)
  - [BaseTransientBottomBar.BaseCallback](https://developer.android.com/reference/android/support/design/widget/BaseTransientBottomBar.BaseCallback)
  - [BottomNavigationView](https://developer.android.com/reference/android/support/design/widget/BottomNavigationView)
  - [BottomSheetBehavior](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior)
  - [BottomSheetBehavior.BottomSheetCallback](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior.BottomSheetCallback)
  - [BottomSheetBehavior.SavedState](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior.SavedState)
  - [BottomSheetDialog](https://developer.android.com/reference/android/support/design/widget/BottomSheetDialog)
  - [BottomSheetDialogFragment](https://developer.android.com/reference/android/support/design/widget/BottomSheetDialogFragment)
  - [CollapsingToolbarLayout](https://developer.android.com/reference/android/support/design/widget/CollapsingToolbarLayout)
  - [CollapsingToolbarLayout.LayoutParams](https://developer.android.com/reference/android/support/design/widget/CollapsingToolbarLayout.LayoutParams)
  - [CoordinatorLayout](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout)
  - [CoordinatorLayout.Behavior](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.Behavior)
  - [CoordinatorLayout.LayoutParams](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.LayoutParams)
  - [CoordinatorLayout.SavedState](https://developer.android.com/reference/android/support/design/widget/CoordinatorLayout.SavedState)
  - [FloatingActionButton](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton)
  - [FloatingActionButton.Behavior](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.Behavior)
  - [FloatingActionButton.OnVisibilityChangedListener](https://developer.android.com/reference/android/support/design/widget/FloatingActionButton.OnVisibilityChangedListener)
  - [NavigationView](https://developer.android.com/reference/android/support/design/widget/NavigationView)
  - [NavigationView.SavedState](https://developer.android.com/reference/android/support/design/widget/NavigationView.SavedState)
  - [Snackbar](https://developer.android.com/reference/android/support/design/widget/Snackbar)
  - [Snackbar.Callback](https://developer.android.com/reference/android/support/design/widget/Snackbar.Callback)
  - [SwipeDismissBehavior](https://developer.android.com/reference/android/support/design/widget/SwipeDismissBehavior)
  - [TabItem](https://developer.android.com/reference/android/support/design/widget/TabItem)
  - [TabLayout](https://developer.android.com/reference/android/support/design/widget/TabLayout)
  - [TabLayout.Tab](https://developer.android.com/reference/android/support/design/widget/TabLayout.Tab)
  - [TabLayout.TabLayoutOnPageChangeListener](https://developer.android.com/reference/android/support/design/widget/TabLayout.TabLayoutOnPageChangeListener)
  - [TabLayout.ViewPagerOnTabSelectedListener](https://developer.android.com/reference/android/support/design/widget/TabLayout.ViewPagerOnTabSelectedListener)
  - [TextInputEditText](https://developer.android.com/reference/android/support/design/widget/TextInputEditText)
  - [TextInputLayout](https://developer.android.com/reference/android/support/design/widget/TextInputLayout)