Files
mobile/patches/react-native-webview+10.2.3.patch
2020-06-09 15:27:46 +02:00

72 lines
3.5 KiB
Diff

diff --git a/node_modules/react-native-webview/apple/RNCWebView.h b/node_modules/react-native-webview/apple/RNCWebView.h
index c55950f..6c0356c 100644
--- a/node_modules/react-native-webview/apple/RNCWebView.h
+++ b/node_modules/react-native-webview/apple/RNCWebView.h
@@ -35,6 +35,7 @@
@property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
@property (nonatomic, assign) BOOL scrollEnabled;
@property (nonatomic, assign) BOOL sharedCookiesEnabled;
+@property (nonatomic, assign) BOOL autoManageStatusBarEnabled;
@property (nonatomic, assign) BOOL pagingEnabled;
@property (nonatomic, assign) CGFloat decelerationRate;
@property (nonatomic, assign) BOOL allowsInlineMediaPlayback;
diff --git a/node_modules/react-native-webview/apple/RNCWebView.m b/node_modules/react-native-webview/apple/RNCWebView.m
index 02b4238..a1f0177 100644
--- a/node_modules/react-native-webview/apple/RNCWebView.m
+++ b/node_modules/react-native-webview/apple/RNCWebView.m
@@ -125,6 +125,7 @@ - (instancetype)initWithFrame:(CGRect)frame
_showsVerticalScrollIndicator = YES;
_directionalLockEnabled = YES;
_automaticallyAdjustContentInsets = YES;
+ _autoManageStatusBarEnabled = YES;
_contentInset = UIEdgeInsetsZero;
_savedKeyboardDisplayRequiresUserAction = YES;
#if !TARGET_OS_OSX
@@ -324,6 +325,9 @@ - (void)removeFromSuperview
-(void)showFullScreenVideoStatusBars
{
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ if (!_autoManageStatusBarEnabled) {
+ return;
+ }
_isFullScreenVideoOpen = YES;
RCTUnsafeExecuteOnMainQueueSync(^{
[RCTSharedApplication() setStatusBarStyle:UIStatusBarStyleLightContent animated:YES];
diff --git a/node_modules/react-native-webview/apple/RNCWebViewManager.m b/node_modules/react-native-webview/apple/RNCWebViewManager.m
index 23ab93b..ea17ae2 100644
--- a/node_modules/react-native-webview/apple/RNCWebViewManager.m
+++ b/node_modules/react-native-webview/apple/RNCWebViewManager.m
@@ -56,6 +56,7 @@ - (RCTUIView *)view
#endif
RCT_EXPORT_VIEW_PROPERTY(contentInset, UIEdgeInsets)
RCT_EXPORT_VIEW_PROPERTY(automaticallyAdjustContentInsets, BOOL)
+RCT_EXPORT_VIEW_PROPERTY(autoManageStatusBarEnabled, BOOL)
RCT_EXPORT_VIEW_PROPERTY(hideKeyboardAccessoryView, BOOL)
RCT_EXPORT_VIEW_PROPERTY(allowsBackForwardNavigationGestures, BOOL)
RCT_EXPORT_VIEW_PROPERTY(incognito, BOOL)
diff --git a/node_modules/react-native-webview/lib/WebViewTypes.d.ts b/node_modules/react-native-webview/lib/WebViewTypes.d.ts
index b532b76..d2427b6 100644
--- a/node_modules/react-native-webview/lib/WebViewTypes.d.ts
+++ b/node_modules/react-native-webview/lib/WebViewTypes.d.ts
@@ -207,6 +207,7 @@ export interface IOSNativeWebViewProps extends CommonNativeWebViewProps {
allowsInlineMediaPlayback?: boolean;
allowsLinkPreview?: boolean;
automaticallyAdjustContentInsets?: boolean;
+ autoManageStatusBarEnabled?: boolean;
bounces?: boolean;
contentInset?: ContentInsetProp;
contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
@@ -329,6 +330,12 @@ export interface IOSWebViewProps extends WebViewSharedProps {
* @platform ios
*/
allowsInlineMediaPlayback?: boolean;
+ /**
+ * Set true if StatusBar should be light when user watch video fullscreen.
+ * The default value is `true`.
+ * @platform ios
+ */
+ autoManageStatusBarEnabled?: boolean;
/**
* Hide the accessory view when the keyboard is open. Default is false to be
* backward compatible.