forked from Ivasoft/mattermost-mobile
241 lines
11 KiB
Diff
241 lines
11 KiB
Diff
diff --git a/node_modules/react-native-navigation/ReactNativeNavigation.podspec b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
|
|
index fab147d..3c66b80 100644
|
|
--- a/node_modules/react-native-navigation/ReactNativeNavigation.podspec
|
|
+++ b/node_modules/react-native-navigation/ReactNativeNavigation.podspec
|
|
@@ -17,18 +17,65 @@ Pod::Spec.new do |s|
|
|
|
|
s.subspec 'Core' do |ss|
|
|
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
|
|
- s.source_files = "lib/ios/**/*.{h,m,mm}"
|
|
+ # s.source_files = "lib/ios/**/*.{h,m,mm}"
|
|
s.exclude_files = "lib/ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
|
|
end
|
|
|
|
- s.subspec 'Fabric' do |ss|
|
|
- ss.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/RCT-Folly\"",
|
|
- "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" }
|
|
- ss.dependency 'React-RCTFabric'
|
|
- ss.dependency 'React-Fabric'
|
|
- ss.dependency 'RCT-Folly/Fabric'
|
|
+ reactJson = JSON.parse(File.read(File.join(__dir__, "..", "react-native", "package.json")))
|
|
+ reactVersion = reactJson["version"]
|
|
+ rnVersion = reactVersion.split('.')[1]
|
|
+
|
|
+ fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
|
+
|
|
+ folly_prefix = ""
|
|
+ if rnVersion.to_i >= 64
|
|
+ folly_prefix = "RCT-"
|
|
+ end
|
|
+
|
|
+ folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DRNVERSION=' + rnVersion
|
|
+ folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
|
|
+ boost_compiler_flags = '-Wno-documentation'
|
|
+ fabric_flags = ''
|
|
+ if fabric_enabled
|
|
+ fabric_flags = '-DRN_FABRIC_ENABLED -DRCT_NEW_ARCH_ENABLED'
|
|
+ end
|
|
+ # s.subspec 'Fabric' do |ss|
|
|
+ # ss.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/RCT-Folly\"",
|
|
+ # "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" }
|
|
+ # ss.dependency 'React-RCTFabric'
|
|
+ # ss.dependency 'React-Fabric'
|
|
+ # ss.dependency 'RCT-Folly/Fabric'
|
|
+ # end
|
|
+ s.source_files = [
|
|
+ "lib/ios/**/*.{mm,h,m}",
|
|
+ "Common/cpp/**/*.cpp",
|
|
+ "Common/cpp/headers/**/*.h"
|
|
+ ]
|
|
+
|
|
+ s.preserve_paths = [
|
|
+ "Common/cpp/hidden_headers/**"
|
|
+ ]
|
|
+
|
|
+ s.pod_target_xcconfig = {
|
|
+ "USE_HEADERMAP" => "YES",
|
|
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
|
|
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
|
|
+ }
|
|
+
|
|
+ s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
|
|
+ s.xcconfig = {
|
|
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/#{folly_prefix}Folly\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\"",
|
|
+ "OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags + " " + fabric_flags }
|
|
+
|
|
+ if fabric_enabled
|
|
+ s.dependency "React-RCTFabric"
|
|
+ s.dependency "React-Codegen"
|
|
+ s.dependency "RCT-Folly"
|
|
+ else
|
|
+ s.dependency "#{folly_prefix}Folly"
|
|
end
|
|
|
|
+
|
|
s.dependency 'React-Core'
|
|
s.dependency 'React-RCTImage'
|
|
s.dependency 'React-RCTText'
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
|
index a34598c..b035a76 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationModule.java
|
|
@@ -59,20 +59,30 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
@Override
|
|
public void onHostPause() {
|
|
super.onHostPause();
|
|
- UiUtils.runOnMainThread(() -> navigator().onHostPause());
|
|
+ Navigator navigator = navigator();
|
|
+ if (navigator != null) {
|
|
+ UiUtils.runOnMainThread(() -> navigator.onHostPause());
|
|
+ }
|
|
}
|
|
|
|
@Override
|
|
public void onHostResume() {
|
|
- eventEmitter = new EventEmitter(reactContext);
|
|
- navigator().setEventEmitter(eventEmitter);
|
|
- layoutFactory.init(
|
|
- activity(),
|
|
- eventEmitter,
|
|
- navigator().getChildRegistry(),
|
|
- ((NavigationApplication) activity().getApplication()).getExternalComponents()
|
|
- );
|
|
- UiUtils.runOnMainThread(() -> navigator().onHostResume());
|
|
+ try {
|
|
+ eventEmitter = new EventEmitter(reactContext);
|
|
+ Navigator navigator = navigator();
|
|
+ if (navigator != null) {
|
|
+ navigator.setEventEmitter(eventEmitter);
|
|
+ layoutFactory.init(
|
|
+ activity(),
|
|
+ eventEmitter,
|
|
+ navigator.getChildRegistry(),
|
|
+ ((NavigationApplication) activity().getApplication()).getExternalComponents()
|
|
+ );
|
|
+ UiUtils.runOnMainThread(() -> navigator.onHostResume());
|
|
+ }
|
|
+ } catch (ClassCastException e) {
|
|
+ // The most current activity is not a NavigationActivity
|
|
+ }
|
|
}
|
|
});
|
|
}
|
|
@@ -210,7 +220,10 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
}
|
|
|
|
private Navigator navigator() {
|
|
- return activity().getNavigator();
|
|
+ if (activity() instanceof NavigationActivity) {
|
|
+ return ((NavigationActivity)activity()).getNavigator();
|
|
+ }
|
|
+ return null;
|
|
}
|
|
|
|
private Options parse(@Nullable ReadableMap mergeOptions) {
|
|
@@ -221,19 +234,23 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
|
protected void handle(Runnable task) {
|
|
UiThread.post(() -> {
|
|
- if (getCurrentActivity() != null && !activity().isFinishing()) {
|
|
- task.run();
|
|
+ try {
|
|
+ if (getCurrentActivity() != null && !activity().isFinishing()) {
|
|
+ task.run();
|
|
+ }
|
|
+ } catch (ClassCastException e) {
|
|
+ // The most current activity is not a NavigationActivity)
|
|
}
|
|
});
|
|
}
|
|
|
|
- protected NavigationActivity activity() {
|
|
- return (NavigationActivity) getCurrentActivity();
|
|
+ protected Activity activity() {
|
|
+ return getCurrentActivity();
|
|
}
|
|
|
|
@Override
|
|
public void onCatalystInstanceDestroy() {
|
|
- final NavigationActivity navigationActivity = activity();
|
|
+ final NavigationActivity navigationActivity = (NavigationActivity)activity();
|
|
if (navigationActivity != null) {
|
|
navigationActivity.onCatalystInstanceDestroy();
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/ReactGateway.java b/node_modules/react-native-navigation/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/ReactGateway.java
|
|
index 035ec31..38109c1 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/ReactGateway.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/ReactGateway.java
|
|
@@ -48,6 +48,12 @@ public class ReactGateway {
|
|
}
|
|
}
|
|
|
|
+ public void onWindowFocusChanged(boolean hasFocus) {
|
|
+ if (host.hasInstance()) {
|
|
+ host.getReactInstanceManager().onWindowFocusChange(hasFocus);
|
|
+ }
|
|
+ }
|
|
+
|
|
public void onActivityPaused(NavigationActivity activity) {
|
|
initializer.onActivityPaused(activity);
|
|
jsDevReloadHandler.onActivityPaused(activity);
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/RNNComponentViewController.m b/node_modules/react-native-navigation/lib/ios/RNNComponentViewController.m
|
|
index 3ce9674..ae34704 100644
|
|
--- a/node_modules/react-native-navigation/lib/ios/RNNComponentViewController.m
|
|
+++ b/node_modules/react-native-navigation/lib/ios/RNNComponentViewController.m
|
|
@@ -94,6 +94,7 @@
|
|
}];
|
|
}];
|
|
self.reactView.backgroundColor = UIColor.clearColor;
|
|
+ self.reactView.frame = UIScreen.mainScreen.bounds;
|
|
self.reactView.translatesAutoresizingMaskIntoConstraints = NO;
|
|
[self.view addSubview:self.reactView];
|
|
[self updateReactViewConstraints];
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/RNNOverlayWindow.m b/node_modules/react-native-navigation/lib/ios/RNNOverlayWindow.m
|
|
index 934e7e7..19169a3 100644
|
|
--- a/node_modules/react-native-navigation/lib/ios/RNNOverlayWindow.m
|
|
+++ b/node_modules/react-native-navigation/lib/ios/RNNOverlayWindow.m
|
|
@@ -1,6 +1,8 @@
|
|
#import "RNNOverlayWindow.h"
|
|
#import "RNNReactView.h"
|
|
#import <React/RCTModalHostView.h>
|
|
+#import <react-native-safe-area-context/RNCSafeAreaView.h>
|
|
+#import <react-native-safe-area-context/RNCSafeAreaProvider.h>
|
|
|
|
@implementation RNNOverlayWindow
|
|
|
|
@@ -9,6 +11,8 @@
|
|
|
|
if ([hitTestResult isKindOfClass:[UIWindow class]] ||
|
|
[hitTestResult.subviews.firstObject isKindOfClass:RNNReactView.class] ||
|
|
+ [hitTestResult isKindOfClass:[RNCSafeAreaView class]] ||
|
|
+ [hitTestResult isKindOfClass:[RNCSafeAreaProvider class]] ||
|
|
[hitTestResult isKindOfClass:[RCTModalHostView class]]) {
|
|
return nil;
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/RNNReactView.h b/node_modules/react-native-navigation/lib/ios/RNNReactView.h
|
|
index f814815..bb39a10 100644
|
|
--- a/node_modules/react-native-navigation/lib/ios/RNNReactView.h
|
|
+++ b/node_modules/react-native-navigation/lib/ios/RNNReactView.h
|
|
@@ -4,6 +4,12 @@
|
|
#import <React/RCTRootView.h>
|
|
#endif
|
|
|
|
+#if RCT_NEW_ARCH_ENABLED
|
|
+
|
|
+// Fabric
|
|
+#import <React/RCTFabricSurfaceHostingProxyRootView.h>
|
|
+#endif
|
|
+
|
|
#import "RNNEventEmitter.h"
|
|
#import "UIView+Utils.h"
|
|
#import <React/RCTRootViewDelegate.h>
|
|
@@ -30,7 +36,7 @@ typedef void (^RNNReactViewReadyCompletionBlock)(void);
|
|
|
|
@end
|
|
|
|
-#ifdef RN_FABRIC_ENABLED
|
|
+#ifdef RCT_NEW_ARCH_ENABLED
|
|
@interface RNNReactView
|
|
: RCTFabricSurfaceHostingProxyRootView <RCTRootViewDelegate, RNNComponentProtocol>
|
|
#else
|