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

BrowserMenuImageText

open class BrowserMenuImageText : BrowserMenuItem (source)

A menu item for displaying text with an image icon.

Parameters

label - The visible label of this menu item.

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

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

textColorResource - Optional ID of color resource to tint the text.

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

Constructors

Name Summary
<init> BrowserMenuImageText(label: String, imageResource: Int, iconTintColorResource: Int = NO_ID, textColorResource: Int = NO_ID, listener: () -> Unit = {})
A menu item for displaying text with an image icon.

Properties

Name Summary
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.

Inherited Properties

Name Summary
interactiveCount open val interactiveCount: () -> Int
Lambda expression that returns the number of interactive elements in this menu item. For example, a simple item will have 1, divider will have 0, and a composite item, like a tool bar, will have several.

Functions

Name Summary
asCandidate open fun asCandidate(context: <ERROR CLASS>): TextMenuCandidate
Converts the menu item into a menu candidate.
bind open 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 open fun getLayoutResource(): <ERROR CLASS>
Returns the layout resource ID of the layout to be inflated for showing a menu item of this type.

Inherited Functions

Name Summary
invalidate open 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.

Inheritors

Name Summary
BrowserMenuHighlightableItem class BrowserMenuHighlightableItem : BrowserMenuImageText, HighlightableMenuItem
A menu item for displaying text with an image icon and a highlight state which sets the background of the menu item and a second image icon to the right of the text.