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

View File

@ -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();

View File

@ -19,13 +19,13 @@ public class CustomWebViewManager extends RNCWebViewManager {
protected static class CustomWebViewClient extends RNCWebViewClient { }
protected static class CustomWebView extends RNCWebView {
public CustomWebView(ReactContext reactContext) {
public CustomWebView(ThemedReactContext reactContext) {
super(reactContext);
}
}
@Override
protected RNCWebView createRNCWebViewInstance(ReactContext reactContext) {
protected RNCWebView createRNCWebViewInstance(ThemedReactContext reactContext) {
return new CustomWebView(reactContext);
}
@ -35,7 +35,7 @@ public class CustomWebViewManager extends RNCWebViewManager {
}
@Override
protected void addEventEmitters(ReactContext reactContext, WebView view) {
protected void addEventEmitters(ThemedReactContext reactContext, WebView view) {
view.setWebViewClient(new CustomWebViewClient());
}
}
@ -52,7 +52,7 @@ public class CustomWebViewManager extends RNCWebViewManager {
...
protected static class CustomWebView extends RNCWebView {
public CustomWebView(ReactContext reactContext) {
public CustomWebView(ThemedReactContext reactContext) {
super(reactContext);
}