android-components / mozilla.components.browser.menu.item / BrowserMenuItemToolbar / Button

Button

class Button (source)

A button to be shown in a toolbar inside the browser menu.

Parameters

imageResource - ID of a drawable resource to be shown as icon.

contentDescription - The button’s content description, used for accessibility support.

iconTintColorResource - Optional ID of color resource to tint the icon.

isEnabled - Lambda to return true/false to indicate if this button should be enabled or disabled.

listener - Callback to be invoked when the button is pressed.

Constructors

Name Summary
<init> Button(imageResource: Int, contentDescription: String, iconTintColorResource: Int = NO_ID, isEnabled: () -> Boolean = { true }, listener: () -> Unit)
A button to be shown in a toolbar inside the browser menu.

Properties

Name Summary
contentDescription val contentDescription: String
The button’s content description, used for accessibility support.
iconTintColorResource val iconTintColorResource: Int
Optional ID of color resource to tint the icon.
imageResource val imageResource: Int
ID of a drawable resource to be shown as icon.
isEnabled val isEnabled: () -> Boolean
Lambda to return true/false to indicate if this button should be enabled or disabled.
listener val listener: () -> Unit
Callback to be invoked when the button is pressed.

Inheritors

Name Summary
TwoStateButton class TwoStateButton : Button
A button that either shows an primary state or an secondary state based on the provided isInPrimaryState lambda.