android-components / / BrowserMenuItem


interface BrowserMenuItem (source)

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


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


Name Summary
asCandidate open fun asCandidate(context: <ERROR CLASS>): MenuCandidate?
Converts the menu item into a menu candidate.
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.


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.
WebExtensionBrowserMenuItem class WebExtensionBrowserMenuItem : BrowserMenuItem
A browser menu item displaying a web extension action.