android-components / mozilla.components.concept.awesomebar / AwesomeBar

AwesomeBar

interface AwesomeBar (source)

Interface to be implemented by awesome bar implementations.

An awesome bar has multiple duties:

Types

Name Summary
Suggestion data class Suggestion
A Suggestion to be displayed by an AwesomeBar implementation.
SuggestionProvider interface SuggestionProvider
A SuggestionProvider is queried by an AwesomeBar whenever the text in the address bar is changed by the user. It returns a list of Suggestions to be displayed by the AwesomeBar.

Functions

Name Summary
addProviders abstract fun addProviders(vararg providers: SuggestionProvider): Unit
Adds the following SuggestionProvider instances to be queried for Suggestions whenever the text changes.
asView open fun asView(): <ERROR CLASS>
Casts this awesome bar to an Android View object.
onInputCancelled open fun onInputCancelled(): Unit
Fired when the user has cancelled their interaction with the awesome bar.
onInputChanged abstract fun onInputChanged(text: String): Unit
Fired whenever the user changes their input, after they have started interacting with the awesome bar.
onInputStarted open fun onInputStarted(): Unit
Fired when the user starts interacting with the awesome bar by entering text in the toolbar.
removeAllProviders abstract fun removeAllProviders(): Unit
Removes all SuggestionProviders
removeProviders abstract fun removeProviders(vararg providers: SuggestionProvider): Unit
Removes the following SuggestionProvider
setOnStopListener abstract fun setOnStopListener(listener: () -> Unit): Unit
Adds a lambda to be invoked when the user has finished interacting with the awesome bar (e.g. selected a suggestion).

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
BrowserAwesomeBar class BrowserAwesomeBar : RecyclerView, AwesomeBar
A customizable AwesomeBar implementation.