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

SimpleBrowserMenuItem

class SimpleBrowserMenuItem : BrowserMenuItem (source)

A simple browser menu item displaying text.

Parameters

label - The visible label of this menu item.

textSize - : The size of the label.

textColorResource - : The color resource to apply to the text.

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

Constructors

Name Summary
<init> SimpleBrowserMenuItem(label: String, textSize: Float = NO_ID.toFloat(), textColorResource: Int = NO_ID, listener: () -> Unit = null)
A simple browser menu item displaying text.

Properties

Name Summary
visible 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 fun asCandidate(context: <ERROR CLASS>): MenuCandidate
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.

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.