mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 03:31:05 +00:00
fix(android): revert change ThemedReactContext to ReactContext
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user