fix(android): revert change ThemedReactContext to ReactContext

This commit is contained in:
Thibault Malbranche
2021-05-21 01:26:56 +02:00
parent 52b6639726
commit 8a45fcf7f9
2 changed files with 10 additions and 9 deletions
@@ -66,6 +66,7 @@ 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;
@@ -170,13 +171,13 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
return REACT_CLASS;
}
protected RNCWebView createRNCWebViewInstance(ReactContext reactContext) {
protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) {
return new RNCWebView(reactContext);
}
@Override
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected WebView createViewInstance(ReactContext reactContext) {
protected WebView createViewInstance(ThemedReactContext reactContext) {
RNCWebView webView = createRNCWebViewInstance(reactContext);
setupWebChromeClient(reactContext, webView);
reactContext.addLifecycleEventListener(webView);
@@ -593,7 +594,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
}
@Override
protected void addEventEmitters(ReactContext reactContext, WebView view) {
protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
// Do not register default touch emitter and let WebView implementation handle touches
view.setWebViewClient(new RNCWebViewClient());
}
@@ -695,7 +696,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
@Override
public void onDropViewInstance(WebView webView) {
super.onDropViewInstance(webView);
((ReactContext) webView.getContext()).removeLifecycleEventListener((RNCWebView) webView);
((ThemedReactContext) webView.getContext()).removeLifecycleEventListener((RNCWebView) webView);
((RNCWebView) webView).cleanupCallbacksAndDestroy();
mWebChromeClient = null;
}
@@ -1443,7 +1444,7 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
* Activity Context is required for creation of dialogs internally by WebView
* Reactive Native needed for access to ReactNative internal system functionality
*/
public RNCWebView(ReactContext reactContext) {
public RNCWebView(ThemedReactContext reactContext) {
super(reactContext);
this.createCatalystInstance();
progressChangedFilter = new ProgressChangedFilter();