make

fun make(view: View, duration: Int, bodyText: String, buttonText: String = view.context.getString(R.string.enterprise_dismiss), isMultiline: Boolean = false, animationMode: Int = BaseTransientBottomBar.ANIMATION_MODE_SLIDE, action: View.OnClickListener? = null): EnterpriseSnackbar

Builds the Snackbar and returns an EnterpriseSnackbar instance that can be stored for future use. Does not call Snackbar.show, see makeAndShow.

Return

This instance of EnterpriseSnackbar to access the internal components.

Parameters

view

The view to find a parent from. This view is also used to find the anchor view when calling Snackbar.setAnchorView.

duration

How long to display the message. Can be Snackbar.LENGTH_SHORT, Snackbar.LENGTH_LONG, Snackbar.LENGTH_INDEFINITE, or a custom duration in milliseconds.

bodyText

The text string to set for bodyTextView.

buttonText

The text string to set for buttonView (defaults to "Dismiss").

isMultiline

If set to true, will use an alternate vertical layout with the bodyTextView above the buttonView, useful for long button text (defaults to false).

animationMode

Defaults to Snackbar.ANIMATION_MODE_SLIDE, can optionally be set to Snackbar.ANIMATION_MODE_FADE.

action

Listener for buttonView's action. Will automatically call Snackbar.dismiss in addition to the provided action.