diff --git a/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java b/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java index e3e878d..7f98fbe 100644 --- a/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +++ b/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java @@ -63,7 +63,6 @@ import com.facebook.react.common.MapBuilder; import com.facebook.react.common.build.ReactBuildConfig; import com.facebook.react.module.annotations.ReactModule; import com.facebook.react.uimanager.SimpleViewManager; -import com.facebook.react.uimanager.ThemedReactContext; import com.facebook.react.uimanager.UIManagerModule; import com.facebook.react.uimanager.annotations.ReactProp; import com.facebook.react.uimanager.events.ContentSizeChangeEvent; @@ -166,13 +165,13 @@ public class RNCWebViewManager extends SimpleViewManager { return REACT_CLASS; } - protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) { + protected RNCWebView createRNCWebViewInstance(ReactContext reactContext) { return new RNCWebView(reactContext); } @Override @TargetApi(Build.VERSION_CODES.LOLLIPOP) - protected WebView createViewInstance(ThemedReactContext reactContext) { + protected WebView createViewInstance(ReactContext reactContext) { RNCWebView webView = createRNCWebViewInstance(reactContext); setupWebChromeClient(reactContext, webView); reactContext.addLifecycleEventListener(webView); @@ -589,7 +588,7 @@ public class RNCWebViewManager extends SimpleViewManager { } @Override - protected void addEventEmitters(ThemedReactContext reactContext, WebView view) { + protected void addEventEmitters(ReactContext reactContext, WebView view) { // Do not register default touch emitter and let WebView implementation handle touches view.setWebViewClient(new RNCWebViewClient()); } @@ -691,7 +690,7 @@ public class RNCWebViewManager extends SimpleViewManager { @Override public void onDropViewInstance(WebView webView) { super.onDropViewInstance(webView); - ((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((RNCWebView) webView); + ((ReactContext) webView.getContext()).removeLifecycleEventListener((RNCWebView) webView); ((RNCWebView) webView).cleanupCallbacksAndDestroy(); mWebChromeClient = null; } @@ -1263,7 +1262,7 @@ public class RNCWebViewManager extends SimpleViewManager { * Activity Context is required for creation of dialogs internally by WebView * Reactive Native needed for access to ReactNative internal system functionality */ - public RNCWebView(ThemedReactContext reactContext) { + public RNCWebView(ReactContext reactContext) { super(reactContext); this.createCatalystInstance(); progressChangedFilter = new ProgressChangedFilter(); diff --git a/docs/Custom-Android.md b/docs/Custom-Android.md index 39ccccf..51ab692 100644 --- a/docs/Custom-Android.md +++ b/docs/Custom-Android.md @@ -19,13 +19,13 @@ public class CustomWebViewManager extends RNCWebViewManager { protected static class CustomWebViewClient extends RNCWebViewClient { } protected static class CustomWebView extends RNCWebView { - public CustomWebView(ThemedReactContext reactContext) { + public CustomWebView(ReactContext reactContext) { super(reactContext); } } @Override - protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) { + protected RNCWebView createRNCWebViewInstance(ReactContext reactContext) { return new CustomWebView(reactContext); } @@ -35,7 +35,7 @@ public class CustomWebViewManager extends RNCWebViewManager { } @Override - protected void addEventEmitters(ThemedReactContext reactContext, WebView view) { + protected void addEventEmitters(ReactContext reactContext, WebView view) { view.setWebViewClient(new CustomWebViewClient()); } } @@ -52,7 +52,7 @@ public class CustomWebViewManager extends RNCWebViewManager { ... protected static class CustomWebView extends RNCWebView { - public CustomWebView(ThemedReactContext reactContext) { + public CustomWebView(ReactContext reactContext) { super(reactContext); }