Make ReactWebView & Client protected
Summary: I'd like to make `ReactWebView` and `ReactWebViewClient` `protected` instead of `private`, inside the `ReactWebViewManager` class. The reason being that if you extend the `ReactWebViewManager` it'll be much easier to override existing logic. In my specific case I'd like to be able to override [shouldOverrideUrlLoading](https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/views/webview/ReactWebViewManager.java#L120) inside `ReactWebViewClient` and handle custom URL schemes differently. See #10055. Closes https://github.com/facebook/react-native/pull/10105 Differential Revision: D4168359 Pulled By: hramos fbshipit-source-id: ff6cbcf1d56536f0db0d2eea937de2cc065a09f9
This commit is contained in:
parent
df6b8bd832
commit
da4df3f12f
|
@ -102,7 +102,7 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
|
||||||
private WebViewConfig mWebViewConfig;
|
private WebViewConfig mWebViewConfig;
|
||||||
private @Nullable WebView.PictureListener mPictureListener;
|
private @Nullable WebView.PictureListener mPictureListener;
|
||||||
|
|
||||||
private static class ReactWebViewClient extends WebViewClient {
|
protected static class ReactWebViewClient extends WebViewClient {
|
||||||
|
|
||||||
private boolean mLastLoadFailed = false;
|
private boolean mLastLoadFailed = false;
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ public class ReactWebViewManager extends SimpleViewManager<WebView> {
|
||||||
* Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order
|
* Subclass of {@link WebView} that implements {@link LifecycleEventListener} interface in order
|
||||||
* to call {@link WebView#destroy} on activty destroy event and also to clear the client
|
* to call {@link WebView#destroy} on activty destroy event and also to clear the client
|
||||||
*/
|
*/
|
||||||
private static class ReactWebView extends WebView implements LifecycleEventListener {
|
protected static class ReactWebView extends WebView implements LifecycleEventListener {
|
||||||
private @Nullable String injectedJS;
|
private @Nullable String injectedJS;
|
||||||
private boolean messagingEnabled = false;
|
private boolean messagingEnabled = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue