android-components / mozilla.components.browser.menu / BrowserMenuItem

BrowserMenuItem

interface BrowserMenuItem (source)

Interface to be implemented by menu items to be shown in the browser menu.

Properties

Name Summary
visible abstract val 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
bind abstract 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 abstract fun getLayoutResource(): Int
Returns the layout resource ID of the layout to be inflated for showing a menu item of this type.
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
BrowserMenuCategory class BrowserMenuCategory : BrowserMenuItem
A browser menu item displaying styleable text, usable for menu categories
BrowserMenuCompoundButton abstract class BrowserMenuCompoundButton : BrowserMenuItem
A browser menu compound button. A basic sub-class would only have to provide a layout resource to satisfy BrowserMenuItem.getLayoutResource which contains a View that inherits from CompoundButton.
BrowserMenuDivider class BrowserMenuDivider : BrowserMenuItem
A browser menu item to display a horizontal divider.
BrowserMenuImageText open class BrowserMenuImageText : BrowserMenuItem
A menu item for displaying text with an image icon.
BrowserMenuItemToolbar class BrowserMenuItemToolbar : BrowserMenuItem
A toolbar of buttons to show inside the browser menu.
SimpleBrowserMenuItem class SimpleBrowserMenuItem : BrowserMenuItem
A simple browser menu item displaying text.