Package 

Class WebViewKt

    • Method Detail

      • WebView

         final static Unit WebView(WebViewState state, Modifier modifier, Boolean captureBackPresses, WebViewNavigator navigator, Function1<WebView, Unit> onCreated, Function1<WebView, Unit> onDispose, AccompanistWebViewClient client, AccompanistWebChromeClient chromeClient, Function1<Context, WebView> factory)

        A wrapper around the Android View WebView to provide a basic WebView composable.

        If you require more customisation you are most likely better rolling your own and using this wrapper as an example.

        The WebView attempts to set the layoutParams based on the Compose modifier passed in. If it is incorrectly sizing, use the layoutParams composable function instead.

        Parameters:
        state - The webview state holder where the Uri to load is defined.
        modifier - A compose modifier
        captureBackPresses - Set to true to have this Composable capture back presses and navigate the WebView back.
        navigator - An optional navigator object that can be used to control the WebView's navigation from outside the composable.
        onCreated - Called when the WebView is first created, this can be used to set additional settings on the WebView.
        onDispose - Called when the WebView is destroyed.
        client - Provides access to WebViewClient via subclassing
        chromeClient - Provides access to WebChromeClient via subclassing
        factory - An optional WebView factory for using a custom subclass of WebView
      • WebView

         final static Unit WebView(WebViewState state, FrameLayout.LayoutParams layoutParams, Modifier modifier, Boolean captureBackPresses, WebViewNavigator navigator, Function1<WebView, Unit> onCreated, Function1<WebView, Unit> onDispose, AccompanistWebViewClient client, AccompanistWebChromeClient chromeClient, Function1<Context, WebView> factory)

        A wrapper around the Android View WebView to provide a basic WebView composable.

        If you require more customisation you are most likely better rolling your own and using this wrapper as an example.

        The WebView attempts to set the layoutParams based on the Compose modifier passed in. If it is incorrectly sizing, use the layoutParams composable function instead.

        Parameters:
        state - The webview state holder where the Uri to load is defined.
        layoutParams - A FrameLayout.LayoutParams object to custom size the underlying WebView.
        modifier - A compose modifier
        captureBackPresses - Set to true to have this Composable capture back presses and navigate the WebView back.
        navigator - An optional navigator object that can be used to control the WebView's navigation from outside the composable.
        onCreated - Called when the WebView is first created, this can be used to set additional settings on the WebView.
        onDispose - Called when the WebView is destroyed.
        client - Provides access to WebViewClient via subclassing
        chromeClient - Provides access to WebChromeClient via subclassing
        factory - An optional WebView factory for using a custom subclass of WebView