-
@Stable() public final class WebViewNavigatorAllows control over the navigation of a WebView from outside the composable. E.g. for performing a back navigation in response to the user clicking the "up" button in a TopAppBar.
-
-
Field Summary
Fields Modifier and Type Field Description private BooleancanGoBackprivate BooleancanGoForward
-
Constructor Summary
Constructors Constructor Description WebViewNavigator(CoroutineScope coroutineScope)
-
Method Summary
Modifier and Type Method Description final BooleangetCanGoBack()True when the web view is able to navigate backwards, false otherwise. final UnitsetCanGoBack(Boolean canGoBack)final BooleangetCanGoForward()True when the web view is able to navigate forwards, false otherwise. final UnitsetCanGoForward(Boolean canGoForward)final UnitloadUrl(String url, Map<String, String> additionalHttpHeaders)final UnitloadHtml(String html, String baseUrl, String mimeType, String encoding, String historyUrl)final UnitpostUrl(String url, ByteArray postData)final UnitnavigateBack()Navigates the webview back to the previous page. final UnitnavigateForward()Navigates the webview forward after going back from a page. final Unitreload()Reloads the current page in the webview. final UnitstopLoading()Stops the current page load (if one is loading). -
-
Method Detail
-
getCanGoBack
final Boolean getCanGoBack()
True when the web view is able to navigate backwards, false otherwise.
-
setCanGoBack
final Unit setCanGoBack(Boolean canGoBack)
-
getCanGoForward
final Boolean getCanGoForward()
True when the web view is able to navigate forwards, false otherwise.
-
setCanGoForward
final Unit setCanGoForward(Boolean canGoForward)
-
loadHtml
final Unit loadHtml(String html, String baseUrl, String mimeType, String encoding, String historyUrl)
-
navigateBack
final Unit navigateBack()
Navigates the webview back to the previous page.
-
navigateForward
final Unit navigateForward()
Navigates the webview forward after going back from a page.
-
stopLoading
final Unit stopLoading()
Stops the current page load (if one is loading).
-
-
-
-