android-components / mozilla.components.browser.toolbar / AsyncFilterListener

AsyncFilterListener

class AsyncFilterListener : OnFilterListener, CoroutineScope (source)

Wraps filter execution in a coroutine context, cancelling prior executions on every invocation. coroutineContext must be of type that doesn’t propagate cancellation of its children upwards.

Constructors

Name Summary
<init> AsyncFilterListener(urlView: AutocompleteView, coroutineContext: CoroutineContext, filter: suspend (String, AutocompleteDelegate) -> Unit, uiContext: CoroutineContext = Dispatchers.Main)
Wraps filter execution in a coroutine context, cancelling prior executions on every invocation. coroutineContext must be of type that doesn’t propagate cancellation of its children upwards.

Properties

Name Summary
coroutineContext val coroutineContext: CoroutineContext

Functions

Name Summary
invoke fun invoke(text: String): Unit

Extension Functions

Name Summary
launchGeckoResult fun <T> CoroutineScope.launchGeckoResult(context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT, block: suspend CoroutineScope.() -> T): GeckoResult<T>
Create a GeckoResult from a co-routine.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.