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

BrowserMenuCategory

class BrowserMenuCategory : BrowserMenuItem (source)

A browser menu item displaying styleable text, usable for menu categories

Parameters

label - The visible label of this menu item.

textSize - : The size of the label.

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

textStyle - : The style to apply to the text.

textAlignment - The alignment of text

Constructors

Name Summary
<init> BrowserMenuCategory(label: String, textSize: Float = NO_ID.toFloat(), textColorResource: Int = NO_ID, textStyle: Int = Typeface.BOLD, textAlignment: Int = View.TEXT_ALIGNMENT_VIEW_START)
A browser menu item displaying styleable text, usable for menu categories

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>): DecorativeTextMenuCandidate
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.