Skip to content

Most visited

Recently visited

navigation
added in version 25.1.0
belongs to Maven artifact com.android.support:design:27.0.0

BaseTransientBottomBar

public abstract class BaseTransientBottomBar
extends Object

java.lang.Object
   ↳ android.support.design.widget.BaseTransientBottomBar<B extends android.support.design.widget.BaseTransientBottomBar<B>>
Known Direct Subclasses


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

Summary

Nested classes

class BaseTransientBottomBar.BaseCallback<B>

Base class for BaseTransientBottomBar callbacks. 

interface BaseTransientBottomBar.ContentViewCallback

Interface that defines the behavior of the main content of a transient bottom bar. 

Constants

int LENGTH_INDEFINITE

Show the Snackbar indefinitely.

int LENGTH_LONG

Show the Snackbar for a long period of time.

int LENGTH_SHORT

Show the Snackbar for a short period of time.

Protected constructors

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

Constructor for the transient bottom bar.

Public methods

B addCallback(BaseCallback<B> callback)

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

void dismiss()

Dismiss the BaseTransientBottomBar.

Context getContext()

Returns the BaseTransientBottomBar's context.

int getDuration()

Return the duration.

View getView()

Returns the BaseTransientBottomBar's view.

boolean isShown()

Return whether this BaseTransientBottomBar is currently being shown.

boolean isShownOrQueued()

Returns whether this BaseTransientBottomBar is currently being shown, or is queued to be shown next.

B removeCallback(BaseCallback<B> callback)

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

B setDuration(int duration)

Set how long to show the view for.

void show()

Show the BaseTransientBottomBar.

Inherited methods

From class java.lang.Object

Constants

LENGTH_INDEFINITE

added in version 25.1.0
int LENGTH_INDEFINITE

Show the Snackbar indefinitely. This means that the Snackbar will be displayed from the time that is shown until either it is dismissed, or another Snackbar is shown.

See also:

Constant Value: -2 (0xfffffffe)

LENGTH_LONG

added in version 25.1.0
int LENGTH_LONG

Show the Snackbar for a long period of time.

See also:

Constant Value: 0 (0x00000000)

LENGTH_SHORT

added in version 25.1.0
int LENGTH_SHORT

Show the Snackbar for a short period of time.

See also:

Constant Value: -1 (0xffffffff)

Protected constructors

BaseTransientBottomBar

added in version 25.1.0
BaseTransientBottomBar (ViewGroup parent, 
                View content, 
                BaseTransientBottomBar.ContentViewCallback contentViewCallback)

Constructor for the transient bottom bar.

Parameters
parent ViewGroup: The parent for this transient bottom bar.

content View: The content view for this transient bottom bar.

contentViewCallback BaseTransientBottomBar.ContentViewCallback: The content view callback for this transient bottom bar.

Public methods

addCallback

added in version 25.1.0
B addCallback (BaseCallback<B> callback)

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

Parameters
callback BaseCallback: Callback to notify when transient bottom bar events occur.

Returns
B

See also:

dismiss

added in version 24.1.0
void dismiss ()

Dismiss the BaseTransientBottomBar.

getContext

added in version 25.1.0
Context getContext ()

Returns the BaseTransientBottomBar's context.

Returns
Context

getDuration

added in version 24.1.0
int getDuration ()

Return the duration.

Returns
int

See also:

getView

added in version 24.1.0
View getView ()

Returns the BaseTransientBottomBar's view.

Returns
View

isShown

added in version 24.1.0
boolean isShown ()

Return whether this BaseTransientBottomBar is currently being shown.

Returns
boolean

isShownOrQueued

added in version 24.1.0
boolean isShownOrQueued ()

Returns whether this BaseTransientBottomBar is currently being shown, or is queued to be shown next.

Returns
boolean

removeCallback

added in version 25.1.0
B removeCallback (BaseCallback<B> callback)

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

Parameters
callback BaseCallback: Callback to remove from being notified of transient bottom bar events

Returns
B

See also:

setDuration

added in version 24.1.0
B setDuration (int duration)

Set how long to show the view for.

Parameters
duration int: either be one of the predefined lengths: LENGTH_SHORT, LENGTH_LONG, or a custom duration in milliseconds.

Returns
B

show

added in version 24.1.0
void show ()

Show the BaseTransientBottomBar.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)