added in version 26.1.0
belongs to Maven artifact com.android.support:design:27.1.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 26.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 26.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 26.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 26.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 26.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

dismiss

added in version 22.2.0
void dismiss ()

Dismiss the BaseTransientBottomBar.

getContext

added in version 26.1.0
Context getContext ()

Returns the BaseTransientBottomBar's context.

Returns
Context

getDuration

added in version 22.2.0
int getDuration ()

Return the duration.

Returns
int

See also:

getView

added in version 22.2.0
View getView ()

Returns the BaseTransientBottomBar's view.

Returns
View

isShown

added in version 23.4.0
boolean isShown ()

Return whether this BaseTransientBottomBar is currently being shown.

Returns
boolean

isShownOrQueued

added in version 23.4.0
boolean isShownOrQueued ()

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

Returns
boolean

removeCallback

added in version 26.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

setDuration

added in version 22.2.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 22.2.0
void show ()

Show the BaseTransientBottomBar.