protected override BlazorAndroidWebView CreatePlatformView() { var blazorAndroidWebView = new BlazorAndroidWebView(Context !) { #pragma warning disable 618 // This can probably be replaced with LinearLayout(LayoutParams.MatchParent, LayoutParams.MatchParent); just need to test that theory LayoutParameters = new Android.Widget.AbsoluteLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent, 0, 0) #pragma warning restore 618 }; // To allow overriding UrlLoadingStrategy.OpenInWebView and open links in browser with a _blank target blazorAndroidWebView.Settings.SetSupportMultipleWindows(true); BlazorAndroidWebView.SetWebContentsDebuggingEnabled(enabled: DeveloperTools.Enabled); if (blazorAndroidWebView.Settings != null) { blazorAndroidWebView.Settings.JavaScriptEnabled = true; blazorAndroidWebView.Settings.DomStorageEnabled = true; } _webViewClient = GetWebViewClient(); blazorAndroidWebView.SetWebViewClient(_webViewClient); _webChromeClient = GetWebChromeClient(); blazorAndroidWebView.SetWebChromeClient(_webChromeClient); return(blazorAndroidWebView); }
protected override AWebView CreateNativeView() { var aWebView = new AWebView(Context !) { #pragma warning disable 618 // This can probably be replaced with LinearLayout(LayoutParams.MatchParent, LayoutParams.MatchParent); just need to test that theory LayoutParameters = new Android.Widget.AbsoluteLayout.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent, 0, 0) #pragma warning restore 618 }; AWebView.SetWebContentsDebuggingEnabled(enabled: true); if (aWebView.Settings != null) { aWebView.Settings.JavaScriptEnabled = true; aWebView.Settings.DomStorageEnabled = true; } _webViewClient = GetWebViewClient(); aWebView.SetWebViewClient(_webViewClient); _webChromeClient = GetWebChromeClient(); aWebView.SetWebChromeClient(_webChromeClient); return(aWebView); }