android-components / mozilla.components.browser.menu.item / BrowserMenuHighlightableSwitch

BrowserMenuHighlightableSwitch

class BrowserMenuHighlightableSwitch : BrowserMenuCompoundButton, HighlightableMenuItem (source)

A browser menu switch that can show a highlighted icon.

Parameters

label - The visible label of this menu item.

initialState - The initial value the checkbox should have.

listener - Callback to be invoked when this menu item is checked.

Constructors

Name Summary
<init> BrowserMenuHighlightableSwitch(label: String, startImageResource: Int, iconTintColorResource: Int = NO_ID, textColorResource: Int = NO_ID, highlight: LowPriority, isHighlighted: () -> Boolean = { true }, initialState: () -> Boolean = { false }, listener: (Boolean) -> Unit)
A browser menu switch that can show a highlighted icon.

Properties

Name Summary
highlight val highlight: LowPriority
Highlight object representing how the menu item will be displayed when highlighted.
isHighlighted val isHighlighted: () -> Boolean
Whether or not to display the highlight

Inherited Properties

Name Summary
label val label: String
The visible label of this menu item.
visible open var visible: () -> Boolean
Lambda expression that returns true if this item should be shown in the menu. Returns false if this item should be hidden.

Functions

Name Summary
asCandidate fun asCandidate(context: <ERROR CLASS>): CompoundMenuCandidate
Converts the menu item into a menu candidate.
bind fun bind(menu: BrowserMenu, view: <ERROR CLASS>): Unit
Called by the browser menu to display the data of this item using the passed view.
getLayoutResource fun getLayoutResource(): Int
Returns the layout resource ID of the layout to be inflated for showing a menu item of this type.
invalidate fun invalidate(view: <ERROR CLASS>): Unit
Called by the browser menu to update the displayed data of this item using the passed view.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.