TWSViewNavigator

class TWSViewNavigator(coroutineScope: CoroutineScope, snippetLoader: SnippetWebLoader)

Allows control over the navigation of a WebView from outside the composable. E.g. for performing a back/forward navigation in response to the user clicking the "up" or "down" button in a TopAppBar.

NOTE: This class is a modified version of the original Accompanist WebView navigator.

Constructors

Link copied to clipboard
constructor(coroutineScope: CoroutineScope, snippetLoader: SnippetWebLoader)

Properties

Link copied to clipboard

True when the web view is able to navigate backwards, false otherwise.

Link copied to clipboard

True when the web view is able to navigate forwards, false otherwise.

Functions

Link copied to clipboard
fun goBack()

Navigates the webview back to the previous page.

Link copied to clipboard
fun goForward()

Navigates the webview forward after going back from a page.

Link copied to clipboard
fun popState()

Navigates back in the browser history.

Link copied to clipboard
fun pushState(path: String)

Pushes a new URL to the browser history and triggers a navigation event.

Link copied to clipboard
fun reload()

Reloads the current page in the webview.

Link copied to clipboard
fun replaceState(path: String)

Replaces current URL with new URL and triggers a navigation event.