Exemple #1
0
        void SetupControl(FormsWebView element)
        {
            var webView = new Android.Webkit.WebView(Forms.Context);

            webView.SetWebViewClient((WebViewClient = new FormsWebViewClient(element, this)));
            webView.SetWebChromeClient((ChromeClient = new FormsWebViewChromeClient(this)));

            // Defaults
            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.DomStorageEnabled = true;

            OnControlChanging?.Invoke(this, element, webView);
            SetNativeControl(webView);
            OnControlChanged?.Invoke(this, element, webView);
        }
        void SetupControl(FormsWebView element)
        {
            var webView = new Android.Webkit.WebView(Forms.Context);

            webView.SetWebViewClient(WebViewClient  = new FormsWebViewClient(element, this));
            webView.SetWebChromeClient(ChromeClient = new FormsWebViewChromeClient(this));

            // https://github.com/SKLn-Rad/Xam.Plugin.Webview/issues/11
            webView.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            // Defaults
            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.DomStorageEnabled = true;

            OnControlChanging?.Invoke(this, element, webView);
            SetNativeControl(webView);
            OnControlChanged?.Invoke(this, element, webView);
        }
        private void SetupControl(FormsWebView element)
        {
            WebViewControlDelegate.OnNavigationRequestedFromUser += OnUserNavigationRequested;
            WebViewControlDelegate.OnInjectJavascriptRequest     += OnInjectJavascriptRequest;
            WebViewControlDelegate.OnActionAdded += OnActionAdded;

            var webView = new Android.Webkit.WebView(Forms.Context);

            webView.SetWebViewClient((WebViewClient = new FormsWebViewClient(element, this)));
            webView.SetWebChromeClient((ChromeClient = new FormsWebViewChromeClient(this)));

            // Defaults
            webView.Settings.JavaScriptEnabled = true;

            OnControlChanging?.Invoke(this, element, webView);
            SetNativeControl(webView);
            OnControlChanged?.Invoke(this, element, webView);
        }
 public override WebViewClient CreateWebViewClient()
 {
     client = new FormsWebViewClient(this);
     return(client);
 }