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

BrowserMenuHighlightableItem

class BrowserMenuHighlightableItem : BrowserMenuImageText, HighlightableMenuItem (source)

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.

Parameters

label - The default visible label of this menu item.

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

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

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

highlight - Highlight object representing how the menu item will be displayed when highlighted.

isHighlighted - Whether or not to display the highlight

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

Types

Name Summary
Highlight class ~~Highlight~~ : ClassicHighlight
Described how to display a BrowserMenuHighlightableItem when it is highlighted. Replaced by BrowserMenuHighlight which lets a priority be specified.

Constructors

Name Summary
<init> BrowserMenuHighlightableItem(label: String, imageResource: Int, iconTintColorResource: Int = NO_ID, textColorResource: Int = NO_ID, highlight: Highlight? = null, listener: () -> Unit = {})BrowserMenuHighlightableItem(label: String, startImageResource: Int, iconTintColorResource: Int = NO_ID, textColorResource: Int = NO_ID, highlight: BrowserMenuHighlight, isHighlighted: () -> Boolean = { true }, listener: () -> Unit = {})
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.

Properties

Name Summary
highlight val highlight: BrowserMenuHighlight
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
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>): TextMenuCandidate
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(): <ERROR CLASS>
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.