android-components / mozilla.components.browser.toolbar / BrowserToolbar / Button

Button

class Button : ActionButton (source)

An action button to be added to the toolbar.

Parameters

imageDrawable - The drawable to be shown.

contentDescription - The content description to use.

visible - Lambda that returns true or false to indicate whether this button should be shown.

background - A custom (stateful) background drawable resource to be used.

padding - a custom Padding for this Button.

listener - Callback that will be invoked whenever the button is pressed

Constructors

<init>

Button(imageDrawable: Drawable, contentDescription: String, visible: () -> Boolean = { true }, background: Int = 0, padding: Padding = DEFAULT_PADDING, listener: () -> Unit)

An action button to be added to the toolbar.

Properties

padding

val padding: Padding

a custom Padding for this Button.

Inherited Properties

contentDescription

val contentDescription: String

The content description to use.

imageDrawable

val imageDrawable: Drawable?

The drawable to be shown.

visible

open val visible: () -> Boolean

Lambda that returns true or false to indicate whether this button should be shown.

Inherited Functions

bind

open fun bind(view: View): Unit

createView

open fun createView(parent: ViewGroup): View

Inheritors

TwoStateButton

class TwoStateButton : Button

An action that either shows an active button or an inactive button based on the provided isEnabled lambda.