* update dev deps * partial update dependencies * update watermelondb * update rn to 0.76.5, expo to 52.0.18 and others * upgrade android firebase * upgrade detox deps * fix package-lock.json * update emm and paste-input * update turbo-log * update network library * fix tests * review feedback * fix Keyboard blocking signIn button * Fall back to iphone 14 iOS 17.2 simulator as app crashes on iOS 17.4 * changes in deleteCredentialsForServer is causing a crash * withOptions x2 clearly is wrong * re-add cli-platform-apple fix * fix: RN 0.76.5 issue with bottom sheet disappearing (#8478) * experiment, using view vs BottomSheetView * revert previous & try disabling enableDynamicSizing * revert an unintended removal --------- Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com> Co-authored-by: Mattermost Build <build@mattermost.com> Co-authored-by: Rahim Rahman <rahim.rahman@mattermost.com>
546 lines
30 KiB
Diff
546 lines
30 KiB
Diff
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java
|
|
index 481aaf0..609e359 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationActivity.java
|
|
@@ -1,18 +1,15 @@
|
|
package com.reactnativenavigation;
|
|
|
|
-import android.annotation.TargetApi;
|
|
import android.content.Intent;
|
|
import android.content.res.Configuration;
|
|
-import android.graphics.Color;
|
|
-import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.view.KeyEvent;
|
|
import android.view.View;
|
|
|
|
+import com.facebook.react.ReactActivity;
|
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
import com.facebook.react.modules.core.PermissionListener;
|
|
-import com.reactnativenavigation.options.Options;
|
|
import com.reactnativenavigation.viewcontrollers.overlay.OverlayManager;
|
|
import com.reactnativenavigation.viewcontrollers.viewcontroller.RootPresenter;
|
|
import com.reactnativenavigation.react.JsDevReloadHandler;
|
|
@@ -25,9 +22,8 @@ import com.reactnativenavigation.viewcontrollers.navigator.Navigator;
|
|
import androidx.activity.OnBackPressedCallback;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
-import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
-public class NavigationActivity extends AppCompatActivity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity, JsDevReloadHandler.ReloadListener {
|
|
+public class NavigationActivity extends ReactActivity implements DefaultHardwareBackBtnHandler, PermissionAwareActivity, JsDevReloadHandler.ReloadListener {
|
|
@Nullable
|
|
private PermissionListener mPermissionListener;
|
|
|
|
@@ -50,7 +46,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
|
);
|
|
navigator.bindViews();
|
|
getReactGateway().onActivityCreated(this);
|
|
- setBackPressedCallback();
|
|
+ // setBackPressedCallback();
|
|
}
|
|
|
|
@Override
|
|
@@ -96,15 +92,16 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
|
|
|
@Override
|
|
public void invokeDefaultOnBackPressed() {
|
|
- if (!navigator.handleBack(new CommandListenerAdapter())) {
|
|
- callback.setEnabled(false);
|
|
- NavigationActivity.super.onBackPressed();
|
|
- callback.setEnabled(true);
|
|
- }
|
|
+ // if (!navigator.handleBack(new CommandListenerAdapter())) {
|
|
+ // callback.setEnabled(false);
|
|
+ // NavigationActivity.super.onBackPressed();
|
|
+ // callback.setEnabled(true);
|
|
+ // }
|
|
+ super.invokeDefaultOnBackPressed();
|
|
}
|
|
|
|
@Override
|
|
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
super.onActivityResult(requestCode, resultCode, data);
|
|
getReactGateway().onActivityResult(this, requestCode, resultCode, data);
|
|
}
|
|
@@ -126,7 +123,6 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
|
return navigator;
|
|
}
|
|
|
|
- @TargetApi(Build.VERSION_CODES.M)
|
|
public void requestPermissions(String[] permissions, int requestCode, PermissionListener listener) {
|
|
mPermissionListener = listener;
|
|
requestPermissions(permissions, requestCode);
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java
|
|
index 0eced0f..251d72c 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/NavigationApplication.java
|
|
@@ -4,6 +4,7 @@ import android.app.Application;
|
|
|
|
import com.facebook.react.ReactApplication;
|
|
import com.facebook.react.ReactNativeHost;
|
|
+import com.facebook.react.soloader.OpenSourceMergedSoMapping;
|
|
import com.facebook.soloader.SoLoader;
|
|
import com.reactnativenavigation.react.ReactGateway;
|
|
import com.reactnativenavigation.viewcontrollers.externalcomponent.ExternalComponentCreator;
|
|
@@ -23,7 +24,11 @@ public abstract class NavigationApplication extends Application implements React
|
|
public void onCreate() {
|
|
super.onCreate();
|
|
instance = this;
|
|
- SoLoader.init(this, false);
|
|
+ try {
|
|
+ SoLoader.init(this, OpenSourceMergedSoMapping.INSTANCE);
|
|
+ } catch (Exception e) {
|
|
+ e.printStackTrace();
|
|
+ }
|
|
reactGateway = createReactGateway();
|
|
}
|
|
|
|
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 4cc09eb..857bbd4 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
|
|
@@ -31,6 +31,7 @@ import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Objects;
|
|
+import java.util.Optional;
|
|
|
|
import static com.reactnativenavigation.utils.UiUtils.pxToDp;
|
|
|
|
@@ -60,21 +61,28 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
public void onHostPause() {
|
|
super.onHostPause();
|
|
UiUtils.runOnMainThread(() -> {
|
|
- if (activity() != null) navigator().onHostPause();
|
|
+ if (activity() != null) navigator().ifPresent(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);
|
|
+ if (navigator().isPresent()) {
|
|
+ Navigator navigator = navigator().get();
|
|
+ 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
|
|
+ }
|
|
}
|
|
});
|
|
}
|
|
@@ -116,7 +124,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
final LayoutNode layoutTree = LayoutNodeParser.parse(Objects.requireNonNull(jsonParser.parse(rawLayoutTree).optJSONObject("root")));
|
|
handle(() -> {
|
|
final ViewController<?> viewController = layoutFactory.create(layoutTree);
|
|
- navigator().setRoot(viewController, new NativeCommandListener("setRoot", commandId, promise, eventEmitter, now), reactInstanceManager);
|
|
+ navigator().ifPresent(nav -> nav.setRoot(viewController, new NativeCommandListener("setRoot", commandId, promise, eventEmitter, now), reactInstanceManager));
|
|
});
|
|
}
|
|
|
|
@@ -125,13 +133,13 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
handle(() -> {
|
|
Options defaultOptions = parse(options);
|
|
layoutFactory.setDefaultOptions(defaultOptions);
|
|
- navigator().setDefaultOptions(defaultOptions);
|
|
+ navigator().ifPresent(nav -> nav.setDefaultOptions(defaultOptions));
|
|
});
|
|
}
|
|
|
|
@ReactMethod
|
|
public void mergeOptions(String onComponentId, @Nullable ReadableMap options) {
|
|
- handle(() -> navigator().mergeOptions(onComponentId, parse(options)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.mergeOptions(onComponentId, parse(options))));
|
|
}
|
|
|
|
@ReactMethod
|
|
@@ -139,7 +147,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
final LayoutNode layoutTree = LayoutNodeParser.parse(jsonParser.parse(rawLayoutTree));
|
|
handle(() -> {
|
|
final ViewController<?> viewController = layoutFactory.create(layoutTree);
|
|
- navigator().push(onComponentId, viewController, new NativeCommandListener("push", commandId, promise, eventEmitter, now));
|
|
+ navigator().ifPresent(nav -> nav.push(onComponentId, viewController, new NativeCommandListener("push", commandId, promise, eventEmitter, now)));
|
|
});
|
|
}
|
|
|
|
@@ -151,23 +159,23 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
final LayoutNode layoutTree = LayoutNodeParser.parse(jsonParser.parse(children.getMap(i)));
|
|
_children.add(layoutFactory.create(layoutTree));
|
|
}
|
|
- navigator().setStackRoot(onComponentId, _children, new NativeCommandListener("setStackRoot", commandId, promise, eventEmitter, now));
|
|
+ navigator().ifPresent(nav -> nav.setStackRoot(onComponentId, _children, new NativeCommandListener("setStackRoot", commandId, promise, eventEmitter, now)));
|
|
});
|
|
}
|
|
|
|
@ReactMethod
|
|
public void pop(String commandId, String componentId, @Nullable ReadableMap mergeOptions, Promise promise) {
|
|
- handle(() -> navigator().pop(componentId, parse(mergeOptions), new NativeCommandListener("pop", commandId, promise, eventEmitter, now)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.pop(componentId, parse(mergeOptions), new NativeCommandListener("pop", commandId, promise, eventEmitter, now))));
|
|
}
|
|
|
|
@ReactMethod
|
|
public void popTo(String commandId, String componentId, @Nullable ReadableMap mergeOptions, Promise promise) {
|
|
- handle(() -> navigator().popTo(componentId, parse(mergeOptions), new NativeCommandListener("popTo", commandId, promise, eventEmitter, now)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.popTo(componentId, parse(mergeOptions), new NativeCommandListener("popTo", commandId, promise, eventEmitter, now))));
|
|
}
|
|
|
|
@ReactMethod
|
|
public void popToRoot(String commandId, String componentId, @Nullable ReadableMap mergeOptions, Promise promise) {
|
|
- handle(() -> navigator().popToRoot(componentId, parse(mergeOptions), new NativeCommandListener("popToRoot", commandId, promise, eventEmitter, now)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.popToRoot(componentId, parse(mergeOptions), new NativeCommandListener("popToRoot", commandId, promise, eventEmitter, now))));
|
|
}
|
|
|
|
@ReactMethod
|
|
@@ -175,21 +183,21 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
final LayoutNode layoutTree = LayoutNodeParser.parse(jsonParser.parse(rawLayoutTree));
|
|
handle(() -> {
|
|
final ViewController<?> viewController = layoutFactory.create(layoutTree);
|
|
- navigator().showModal(viewController, new NativeCommandListener("showModal", commandId, promise, eventEmitter, now));
|
|
+ navigator().ifPresent(nav -> nav.showModal(viewController, new NativeCommandListener("showModal", commandId, promise, eventEmitter, now)));
|
|
});
|
|
}
|
|
|
|
@ReactMethod
|
|
public void dismissModal(String commandId, String componentId, @Nullable ReadableMap mergeOptions, Promise promise) {
|
|
handle(() -> {
|
|
- navigator().mergeOptions(componentId, parse(mergeOptions));
|
|
- navigator().dismissModal(componentId, new NativeCommandListener("dismissModal", commandId, promise, eventEmitter, now));
|
|
+ navigator().ifPresent(nav -> nav.mergeOptions(componentId, parse(mergeOptions)));
|
|
+ navigator().ifPresent(nav -> nav.dismissModal(componentId, new NativeCommandListener("dismissModal", commandId, promise, eventEmitter, now)));
|
|
});
|
|
}
|
|
|
|
@ReactMethod
|
|
public void dismissAllModals(String commandId, @Nullable ReadableMap mergeOptions, Promise promise) {
|
|
- handle(() -> navigator().dismissAllModals(parse(mergeOptions), new NativeCommandListener("dismissAllModals", commandId, promise, eventEmitter, now)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.dismissAllModals(parse(mergeOptions), new NativeCommandListener("dismissAllModals", commandId, promise, eventEmitter, now))));
|
|
}
|
|
|
|
@ReactMethod
|
|
@@ -197,22 +205,25 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
final LayoutNode layoutTree = LayoutNodeParser.parse(jsonParser.parse(rawLayoutTree));
|
|
handle(() -> {
|
|
final ViewController<?> viewController = layoutFactory.create(layoutTree);
|
|
- navigator().showOverlay(viewController, new NativeCommandListener("showOverlay", commandId, promise, eventEmitter, now));
|
|
+ navigator().ifPresent(nav -> nav.showOverlay(viewController, new NativeCommandListener("showOverlay", commandId, promise, eventEmitter, now)));
|
|
});
|
|
}
|
|
|
|
@ReactMethod
|
|
public void dismissOverlay(String commandId, String componentId, Promise promise) {
|
|
- handle(() -> navigator().dismissOverlay(componentId, new NativeCommandListener("dismissOverlay", commandId, promise, eventEmitter, now)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.dismissOverlay(componentId, new NativeCommandListener("dismissOverlay", commandId, promise, eventEmitter, now))));
|
|
}
|
|
|
|
@ReactMethod
|
|
public void dismissAllOverlays(String commandId, Promise promise) {
|
|
- handle(() -> navigator().dismissAllOverlays(new NativeCommandListener("dismissAllOverlays", commandId, promise, eventEmitter, now)));
|
|
+ handle(() -> navigator().ifPresent(nav -> nav.dismissAllOverlays(new NativeCommandListener("dismissAllOverlays", commandId, promise, eventEmitter, now))));
|
|
}
|
|
|
|
- private Navigator navigator() {
|
|
- return activity().getNavigator();
|
|
+ private Optional<Navigator> navigator() {
|
|
+ if (activity() instanceof NavigationActivity) {
|
|
+ return Optional.ofNullable(((NavigationActivity)activity()).getNavigator());
|
|
+ }
|
|
+ return Optional.empty();
|
|
}
|
|
|
|
private Options parse(@Nullable ReadableMap mergeOptions) {
|
|
@@ -223,22 +234,26 @@ 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();
|
|
+ public void invalidate() {
|
|
+ final NavigationActivity navigationActivity = (NavigationActivity)activity();
|
|
if (navigationActivity != null) {
|
|
navigationActivity.onCatalystInstanceDestroy();
|
|
}
|
|
- super.onCatalystInstanceDestroy();
|
|
+ super.invalidate();
|
|
}
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java
|
|
index 834d734..3fc00c3 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactTypefaceUtils.java
|
|
@@ -96,12 +96,12 @@ public class ReactTypefaceUtils {
|
|
|
|
int want = 0;
|
|
if ((weight == Typeface.BOLD)
|
|
- || ((oldStyle & Typeface.BOLD) != 0 && weight == ReactTextShadowNode.UNSET)) {
|
|
+ || ((oldStyle & Typeface.BOLD) != 0 && weight == -1)) {
|
|
want |= Typeface.BOLD;
|
|
}
|
|
|
|
if ((style == Typeface.ITALIC)
|
|
- || ((oldStyle & Typeface.ITALIC) != 0 && style == ReactTextShadowNode.UNSET)) {
|
|
+ || ((oldStyle & Typeface.ITALIC) != 0 && style == -1)) {
|
|
want |= Typeface.ITALIC;
|
|
}
|
|
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt
|
|
index f92580c..a58fa7b 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ReactViewGroup.kt
|
|
@@ -4,4 +4,4 @@ import com.facebook.react.views.view.ReactViewBackgroundDrawable
|
|
import com.facebook.react.views.view.ReactViewGroup
|
|
|
|
val ReactViewGroup.borderRadius: Float
|
|
- get() = (background as? ReactViewBackgroundDrawable)?.fullBorderRadius ?: 0f
|
|
\ No newline at end of file
|
|
+ get() = 0f
|
|
\ No newline at end of file
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java
|
|
index 3acc41d..ebc8d18 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/child/ChildController.java
|
|
@@ -7,6 +7,7 @@ import android.util.Log;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.view.WindowInsets;
|
|
+import android.view.WindowManager;
|
|
|
|
import com.reactnativenavigation.options.Options;
|
|
import com.reactnativenavigation.utils.LogKt;
|
|
@@ -100,6 +101,18 @@ public abstract class ChildController<T extends ViewGroup> extends ViewControlle
|
|
}
|
|
|
|
protected WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat insets) {
|
|
+ Activity activity = getActivity();
|
|
+ Insets ime = insets.getInsets(WindowInsetsCompat.Type.ime());
|
|
+ if (activity != null) {
|
|
+ int softInputMode = activity.getWindow().getAttributes().softInputMode;
|
|
+ if (softInputMode == WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING && !isRoot()) {
|
|
+ view.setPadding(ime.left, ime.top, ime.right, 0);
|
|
+ return WindowInsetsCompat.CONSUMED;
|
|
+ }
|
|
+ }
|
|
+ if (!isRoot()) {
|
|
+ view.setPadding(0, 0, 0, 0);
|
|
+ }
|
|
return insets;
|
|
}
|
|
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt
|
|
index 89216ae..345207a 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/viewcontroller/LayoutDirectionApplier.kt
|
|
@@ -1,15 +1,17 @@
|
|
package com.reactnativenavigation.viewcontrollers.viewcontroller
|
|
|
|
+import com.facebook.react.bridge.ReactContext
|
|
import com.facebook.react.ReactInstanceManager
|
|
import com.facebook.react.modules.i18nmanager.I18nUtil
|
|
import com.reactnativenavigation.options.Options
|
|
|
|
class LayoutDirectionApplier {
|
|
fun apply(root: ViewController<*>, options: Options, instanceManager: ReactInstanceManager) {
|
|
- if (options.layout.direction.hasValue() && instanceManager.currentReactContext != null) {
|
|
+ val reactContext = instanceManager.currentReactContext as? ReactContext
|
|
+ if (reactContext != null && options.layout.direction.hasValue()) {
|
|
root.activity.window.decorView.layoutDirection = options.layout.direction.get()
|
|
- I18nUtil.getInstance().allowRTL(instanceManager.currentReactContext, options.layout.direction.isRtl)
|
|
- I18nUtil.getInstance().forceRTL(instanceManager.currentReactContext, options.layout.direction.isRtl)
|
|
+ I18nUtil.getInstance().allowRTL(reactContext, options.layout.direction.isRtl)
|
|
+ I18nUtil.getInstance().forceRTL(reactContext, options.layout.direction.isRtl)
|
|
}
|
|
}
|
|
}
|
|
\ No newline at end of file
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java b/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java
|
|
index 035ec31..630b8d4 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/ReactGateway.java
|
|
@@ -69,4 +69,10 @@ public class ReactGateway {
|
|
public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
|
|
host.getReactInstanceManager().onActivityResult(activity, requestCode, resultCode, data);
|
|
}
|
|
+
|
|
+ public void onWindowFocusChanged(boolean hasFocus) {
|
|
+ if (host.hasInstance()) {
|
|
+ host.getReactInstanceManager().onWindowFocusChange(hasFocus);
|
|
+ }
|
|
+ }
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt b/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt
|
|
index ea8516f..f275c18 100644
|
|
--- a/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt
|
|
+++ b/node_modules/react-native-navigation/lib/android/app/src/reactNative71/java/com/reactnativenavigation/react/modal/ModalContentLayout.kt
|
|
@@ -50,13 +50,19 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{
|
|
}
|
|
}
|
|
override fun onChildStartedNativeGesture(child: View, androidEvent: MotionEvent?) {
|
|
- mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher())
|
|
+ androidEvent?.let {
|
|
+ mJSTouchDispatcher.onChildStartedNativeGesture(it, this.getEventDispatcher()!!)
|
|
+ }
|
|
}
|
|
override fun onChildStartedNativeGesture(androidEvent: MotionEvent?) {
|
|
- mJSTouchDispatcher.onChildStartedNativeGesture(androidEvent, this.getEventDispatcher())
|
|
+ androidEvent?.let {
|
|
+ mJSTouchDispatcher.onChildStartedNativeGesture(it, this.getEventDispatcher()!!)
|
|
+ }
|
|
}
|
|
override fun onChildEndedNativeGesture(child: View, androidEvent: MotionEvent?) {
|
|
- mJSTouchDispatcher.onChildEndedNativeGesture(androidEvent, this.getEventDispatcher())
|
|
+ androidEvent?.let {
|
|
+ mJSTouchDispatcher.onChildEndedNativeGesture(it, this.getEventDispatcher()!!)
|
|
+ }
|
|
}
|
|
override fun requestDisallowInterceptTouchEvent(disallowIntercept: Boolean) {}
|
|
private fun getEventDispatcher(): EventDispatcher? {
|
|
@@ -74,12 +80,16 @@ class ModalContentLayout(context: Context?) : ReactViewGroup(context), RootView{
|
|
}
|
|
|
|
override fun onInterceptTouchEvent(event: MotionEvent?): Boolean {
|
|
- mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher())
|
|
+ event?.let {
|
|
+ mJSTouchDispatcher.handleTouchEvent(it, getEventDispatcher()!!)
|
|
+ }
|
|
return super.onInterceptTouchEvent(event)
|
|
}
|
|
|
|
override fun onTouchEvent(event: MotionEvent?): Boolean {
|
|
- mJSTouchDispatcher.handleTouchEvent(event, getEventDispatcher())
|
|
+ event?.let {
|
|
+ mJSTouchDispatcher.handleTouchEvent(it, getEventDispatcher()!!)
|
|
+ }
|
|
super.onTouchEvent(event)
|
|
return true
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/BottomTabsBasePresenter.m b/node_modules/react-native-navigation/lib/ios/BottomTabsBasePresenter.m
|
|
index 75aa424..f0a7e08 100644
|
|
--- a/node_modules/react-native-navigation/lib/ios/BottomTabsBasePresenter.m
|
|
+++ b/node_modules/react-native-navigation/lib/ios/BottomTabsBasePresenter.m
|
|
@@ -29,8 +29,6 @@
|
|
[self applyBackgroundColor:[withDefault.bottomTabs.backgroundColor withDefault:nil]
|
|
translucent:[withDefault.bottomTabs.translucent withDefault:NO]];
|
|
[bottomTabs setTabBarHideShadow:[withDefault.bottomTabs.hideShadow withDefault:NO]];
|
|
- [bottomTabs setTabBarStyle:[RCTConvert UIBarStyle:[withDefault.bottomTabs.barStyle
|
|
- withDefault:@"default"]]];
|
|
[self applyTabBarBorder:withDefault.bottomTabs];
|
|
[self applyTabBarShadow:withDefault.bottomTabs.shadow];
|
|
}
|
|
@@ -59,10 +57,6 @@
|
|
[self setTabBarBackgroundColor:mergeOptions.bottomTabs.backgroundColor.get];
|
|
}
|
|
|
|
- if (mergeOptions.bottomTabs.barStyle.hasValue) {
|
|
- [bottomTabs setTabBarStyle:[RCTConvert UIBarStyle:mergeOptions.bottomTabs.barStyle.get]];
|
|
- }
|
|
-
|
|
if (mergeOptions.bottomTabs.translucent.hasValue) {
|
|
[bottomTabs setTabBarTranslucent:mergeOptions.bottomTabs.translucent.get];
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/RNNComponentViewController.m b/node_modules/react-native-navigation/lib/ios/RNNComponentViewController.m
|
|
index fc482a6..9406bbf 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.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
|
[self.reactView setFrame:self.view.frame];
|
|
[self.view addSubview:self.reactView];
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/RNNOverlayWindow.m b/node_modules/react-native-navigation/lib/ios/RNNOverlayWindow.m
|
|
index b44f24f..bf4e1c3 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]] ||
|
|
[hitTestResult isKindOfClass:NSClassFromString(@"RCTRootComponentView")]) {
|
|
return nil;
|
|
diff --git a/node_modules/react-native-navigation/lib/ios/RNNStackPresenter.m b/node_modules/react-native-navigation/lib/ios/RNNStackPresenter.m
|
|
index 5f4218e..8513863 100644
|
|
--- a/node_modules/react-native-navigation/lib/ios/RNNStackPresenter.m
|
|
+++ b/node_modules/react-native-navigation/lib/ios/RNNStackPresenter.m
|
|
@@ -67,8 +67,6 @@
|
|
[_interactivePopGestureDelegate setEnabled:[withDefault.popGesture withDefault:YES]];
|
|
stack.interactivePopGestureRecognizer.delegate = _interactivePopGestureDelegate;
|
|
|
|
- [stack
|
|
- setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle withDefault:@"default"]]];
|
|
[stack setRootBackgroundImage:[withDefault.rootBackgroundImage withDefault:nil]];
|
|
[stack setNavigationBarTestId:[withDefault.topBar.testID withDefault:nil]];
|
|
[stack setNavigationBarVisible:[withDefault.topBar.visible withDefault:YES]
|
|
@@ -125,10 +123,6 @@
|
|
[stack hideBarsOnScroll:[mergeOptions.topBar.hideOnScroll get]];
|
|
}
|
|
|
|
- if (mergeOptions.topBar.barStyle.hasValue) {
|
|
- [stack setBarStyle:[RCTConvert UIBarStyle:mergeOptions.topBar.barStyle.get]];
|
|
- }
|
|
-
|
|
if (mergeOptions.topBar.background.clipToBounds.hasValue) {
|
|
[stack setNavigationBarClipsToBounds:[mergeOptions.topBar.background.clipToBounds get]];
|
|
}
|
|
diff --git a/node_modules/react-native-navigation/lib/src/interfaces/Options.ts b/node_modules/react-native-navigation/lib/src/interfaces/Options.ts
|
|
index 1ab5b4e..ccd0b74 100644
|
|
--- a/node_modules/react-native-navigation/lib/src/interfaces/Options.ts
|
|
+++ b/node_modules/react-native-navigation/lib/src/interfaces/Options.ts
|
|
@@ -1,5 +1,5 @@
|
|
// tslint:disable jsdoc-format
|
|
-import { ImageRequireSource, ImageSourcePropType, Insets, OpaqueColorValue } from 'react-native';
|
|
+import type { ImageRequireSource, ImageSourcePropType, Insets, OpaqueColorValue } from 'react-native';
|
|
|
|
// TODO: Import ColorValue instead when upgrading @types/react-native to 0.63+
|
|
// Only assign PlatformColor or DynamicColorIOS as a Color symbol!
|