android-components / mozilla.components.concept.toolbar / Toolbar

Toolbar

interface Toolbar (source)

Interface to be implemented by components that provide browser toolbar functionality.

Types

Name Summary
Action interface Action
Generic interface for actions to be added to the toolbar.
ActionButton open class ActionButton : Action
An action button to be added to the toolbar.
ActionImage open class ActionImage : Action
An action that just shows a static, non-clickable image.
ActionSpace open class ActionSpace : Action
An “empty” action with a desired width to be used as “placeholder”.
ActionToggleButton open class ActionToggleButton : Action
An action button with two states, selected and unselected. When the button is pressed, the state changes automatically.
OnEditListener interface OnEditListener
Listener to be invoked when the user edits the URL.
SiteSecurity enum class SiteSecurity
SiteTrackingProtection enum class SiteTrackingProtection
Indicates which tracking protection status a site has.

Properties

Name Summary
private abstract var private: Boolean
Sets/gets private mode.
siteSecure abstract var siteSecure: SiteSecurity
Sets/Gets the site security to be displayed on the toolbar.
siteTrackingProtection abstract var siteTrackingProtection: SiteTrackingProtection
Sets/Gets the site tracking protection state to be displayed on the toolbar.
title abstract var title: String
Sets/Gets the title to be displayed on the toolbar.
url abstract var url: CharSequence
Sets/Gets the URL to be displayed on the toolbar.

Functions

Name Summary
addBrowserAction abstract fun addBrowserAction(action: Action): Unit
Adds an action to be displayed on the right side of the toolbar in display mode.
addEditAction abstract fun addEditAction(action: Action): Unit
Adds an action to be displayed in edit mode.
addNavigationAction abstract fun addNavigationAction(action: Action): Unit
Adds an action to be displayed on the far left side of the URL in display mode.
addPageAction abstract fun addPageAction(action: Action): Unit
Adds an action to be displayed on the right side of the URL in display mode.
asView open fun asView(): <ERROR CLASS>
Casts this toolbar to an Android View object.
displayMode abstract fun displayMode(): Unit
Switches to URL displaying mode (from editing mode) if supported by the toolbar implementation.
displayProgress abstract fun displayProgress(progress: Int): Unit
Displays the given loading progress. Expects values in the range 0,100.
editMode abstract fun editMode(): Unit
Switches to URL editing mode (from displaying mode) if supported by the toolbar implementation.
invalidateActions abstract fun invalidateActions(): Unit
Declare that the actions (navigation actions, browser actions, page actions) have changed and should be updated if needed.
onBackPressed abstract fun onBackPressed(): Boolean
Should be called by an activity when the user pressed the back key of the device.
onStop abstract fun onStop(): Unit
Should be called by the host activity when it enters the stop state.
setAutocompleteListener abstract fun setAutocompleteListener(filter: suspend (String, AutocompleteDelegate) -> Unit): Unit
Registers the given function to be invoked when users changes text in the toolbar.
setOnEditListener abstract fun setOnEditListener(listener: OnEditListener): Unit
Registers the given listener to be invoked when the user edits the URL.
setOnUrlCommitListener abstract fun setOnUrlCommitListener(listener: (String) -> Boolean): Unit
Registers the given function to be invoked when the user selected a new URL i.e. is done editing.
setSearchTerms abstract fun setSearchTerms(searchTerms: String): Unit
Displays the currently used search terms as part of this Toolbar.

Inheritors

Name Summary
BrowserToolbar class BrowserToolbar : Toolbar
A customizable toolbar for browsers.