This repository was archived by the owner on Apr 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
CustomRenderers/HybridWebView/Droid Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1- using CustomRenderer ;
1+ using Android . Content ;
2+ using CustomRenderer ;
23using CustomRenderer . Droid ;
34using Xamarin . Forms ;
45using Xamarin . Forms . Platform . Android ;
5- using Android . Content ;
66
77[ assembly: ExportRenderer ( typeof ( HybridWebView ) , typeof ( HybridWebViewRenderer ) ) ]
88namespace CustomRenderer . Droid
@@ -28,7 +28,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<WebView> e)
2828 }
2929 if ( e . NewElement != null )
3030 {
31- Control . SetWebViewClient ( new JavascriptWebViewClient ( $ "javascript: { JavascriptFunction } ") ) ;
31+ Control . SetWebViewClient ( new JavascriptWebViewClient ( this , $ "javascript: { JavascriptFunction } ") ) ;
3232 Control . AddJavascriptInterface ( new JSBridge ( this ) , "jsBridge" ) ;
3333 Control . LoadUrl ( $ "file:///android_asset/Content/{ ( ( HybridWebView ) Element ) . Uri } ") ;
3434 }
Original file line number Diff line number Diff line change 11using Android . Webkit ;
2+ using Xamarin . Forms . Platform . Android ;
23
34namespace CustomRenderer . Droid
45{
5- public class JavascriptWebViewClient : WebViewClient
6+ public class JavascriptWebViewClient : FormsWebViewClient
67 {
78 string _javascript ;
89
9- public JavascriptWebViewClient ( string javascript )
10+ public JavascriptWebViewClient ( HybridWebViewRenderer renderer , string javascript ) : base ( renderer )
1011 {
1112 _javascript = javascript ;
1213 }
You can’t perform that action at this time.
0 commit comments