-
@Stable() public final class WebViewStateA state holder to hold the state for the WebView. In most cases this will be remembered using the rememberWebViewState(uri) function.
-
-
Field Summary
Fields Modifier and Type Field Description private StringlastLoadedUrlprivate WebContentcontentprivate LoadingStateloadingStateprivate final BooleanisLoadingprivate StringpageTitleprivate BitmappageIconprivate final SnapshotStateList<WebViewError>errorsForCurrentRequestprivate BundleviewState
-
Constructor Summary
Constructors Constructor Description WebViewState(WebContent webContent)
-
Method Summary
Modifier and Type Method Description final StringgetLastLoadedUrl()final UnitsetLastLoadedUrl(String lastLoadedUrl)final WebContentgetContent()The content being loaded by the WebView final UnitsetContent(WebContent content)The content being loaded by the WebView final LoadingStategetLoadingState()Whether the WebView is currently LoadingState.Loading data in its main frame (along with progress) or the data loading has LoadingState.Finished. final UnitsetLoadingState(LoadingState loadingState)final BooleangetIsLoading()final StringgetPageTitle()The title received from the loaded content of the current page final UnitsetPageTitle(String pageTitle)final BitmapgetPageIcon()the favicon received from the loaded content of the current page final UnitsetPageIcon(Bitmap pageIcon)final SnapshotStateList<WebViewError>getErrorsForCurrentRequest()A list for errors captured in the last load. final BundlegetViewState()The saved view state from when the view was destroyed last. final UnitsetViewState(Bundle viewState)-
-
Constructor Detail
-
WebViewState
WebViewState(WebContent webContent)
-
-
Method Detail
-
getLastLoadedUrl
final String getLastLoadedUrl()
-
setLastLoadedUrl
final Unit setLastLoadedUrl(String lastLoadedUrl)
-
getContent
final WebContent getContent()
The content being loaded by the WebView
-
setContent
final Unit setContent(WebContent content)
The content being loaded by the WebView
-
getLoadingState
final LoadingState getLoadingState()
Whether the WebView is currently LoadingState.Loading data in its main frame (along with progress) or the data loading has LoadingState.Finished. See LoadingState
-
setLoadingState
final Unit setLoadingState(LoadingState loadingState)
-
getIsLoading
final Boolean getIsLoading()
-
getPageTitle
final String getPageTitle()
The title received from the loaded content of the current page
-
setPageTitle
final Unit setPageTitle(String pageTitle)
-
getPageIcon
final Bitmap getPageIcon()
the favicon received from the loaded content of the current page
-
setPageIcon
final Unit setPageIcon(Bitmap pageIcon)
-
getErrorsForCurrentRequest
final SnapshotStateList<WebViewError> getErrorsForCurrentRequest()
A list for errors captured in the last load. Reset when a new page is loaded. Errors could be from any resource (iframe, image, etc.), not just for the main page. For more fine grained control use the OnError callback of the WebView.
-
getViewState
final Bundle getViewState()
The saved view state from when the view was destroyed last. To restore state, use the navigator and only call loadUrl if the bundle is null. See WebViewSaveStateSample.
-
setViewState
final Unit setViewState(Bundle viewState)
-
-
-
-