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

BrowserMenuBuilder

open class BrowserMenuBuilder (source)

Helper class for building browser menus.

Parameters

items - List of BrowserMenuItem objects to compose the menu from.

extras - Map of extra values that are added to emitted facts

endOfMenuAlwaysVisible - when is set to true makes sure the bottom of the menu is always visible otherwise, the top of the menu is always visible.

Constructors

Name Summary
<init> BrowserMenuBuilder(items: List<BrowserMenuItem>, extras: Map<String, Any> = emptyMap(), endOfMenuAlwaysVisible: Boolean = false)
Helper class for building browser menus.

Properties

Name Summary
endOfMenuAlwaysVisible val endOfMenuAlwaysVisible: Boolean
when is set to true makes sure the bottom of the menu is always visible otherwise, the top of the menu is always visible.
extras val extras: Map<String, Any>
Map of extra values that are added to emitted facts
items val items: List<BrowserMenuItem>
List of BrowserMenuItem objects to compose the menu from.

Functions

Name Summary
build open fun build(context: <ERROR CLASS>): BrowserMenu
Builds and returns a browser menu with items

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
WebExtensionBrowserMenuBuilder class WebExtensionBrowserMenuBuilder : BrowserMenuBuilder
Browser menu builder with web extension support. It allows WebExtensionBrowserMenu to add web extension browser actions in a nested menu item. If there are no web extensions installed, the web extension menu item would return an add-on manager menu item instead.