hybrid-navigation 2.18.12 → 2.18.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/android/build.gradle
CHANGED
|
@@ -33,5 +33,5 @@ dependencies {
|
|
|
33
33
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
34
34
|
implementation 'com.facebook.react:react-native:+'
|
|
35
35
|
// api project(':navigation')
|
|
36
|
-
api 'io.github.listenzz:AndroidNavigation:13.8.
|
|
36
|
+
api 'io.github.listenzz:AndroidNavigation:13.8.4'
|
|
37
37
|
}
|
|
@@ -15,6 +15,7 @@ import static com.reactnative.hybridnavigation.HBDEventEmitter.ON_COMPONENT_RESU
|
|
|
15
15
|
import android.annotation.SuppressLint;
|
|
16
16
|
import android.app.Activity;
|
|
17
17
|
import android.content.pm.ActivityInfo;
|
|
18
|
+
import android.content.res.Configuration;
|
|
18
19
|
import android.graphics.Color;
|
|
19
20
|
import android.os.Bundle;
|
|
20
21
|
import android.view.Gravity;
|
|
@@ -88,8 +89,13 @@ public class ReactFragment extends HybridFragment implements ReactBridgeManager.
|
|
|
88
89
|
if (!forceScreenLandscape() &&
|
|
89
90
|
!Navigator.MODE_MODAL.equals(Navigator.Util.getMode(this)) &&
|
|
90
91
|
requireActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
|
|
92
|
+
requireView().clearAnimation();
|
|
91
93
|
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
|
|
92
94
|
}
|
|
95
|
+
|
|
96
|
+
if (forceScreenLandscape()) {
|
|
97
|
+
requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
|
98
|
+
}
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
@Override
|
|
@@ -101,22 +107,10 @@ public class ReactFragment extends HybridFragment implements ReactBridgeManager.
|
|
|
101
107
|
}
|
|
102
108
|
|
|
103
109
|
@Override
|
|
104
|
-
public void
|
|
105
|
-
super.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
@SuppressLint("SourceLockedOrientationActivity")
|
|
112
|
-
@Override
|
|
113
|
-
public void onStop() {
|
|
114
|
-
if (isRemoving() && forceScreenLandscape()) {
|
|
115
|
-
Activity activity = requireActivity();
|
|
116
|
-
activity.getWindow().getDecorView().postDelayed(() ->
|
|
117
|
-
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT), 16);
|
|
118
|
-
}
|
|
119
|
-
super.onStop();
|
|
110
|
+
public void onConfigurationChanged(@NonNull Configuration newConfig) {
|
|
111
|
+
super.onConfigurationChanged(newConfig);
|
|
112
|
+
// 避免屏幕旋转时状态栏样式不更新的问题
|
|
113
|
+
setNeedsStatusBarAppearanceUpdate();
|
|
120
114
|
}
|
|
121
115
|
|
|
122
116
|
private boolean isViewReady() {
|
package/dist/Navigator.js
CHANGED
|
@@ -77,6 +77,7 @@ class Navigator {
|
|
|
77
77
|
moduleName,
|
|
78
78
|
inclusive,
|
|
79
79
|
from: this.moduleName,
|
|
80
|
+
to: moduleName,
|
|
80
81
|
});
|
|
81
82
|
popToRoot = () => Navigation.dispatch(this.sceneId, 'popToRoot', { from: this.moduleName });
|
|
82
83
|
redirectTo = (moduleName, props = {}, options = {}) => Navigation.dispatch(this.sceneId, 'redirectTo', {
|
|
@@ -96,6 +96,13 @@
|
|
|
96
96
|
return NO;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
- (void)viewWillAppear:(BOOL)animated {
|
|
100
|
+
[super viewWillAppear:animated];
|
|
101
|
+
if (!self.navigationController.transitionCoordinator.interactive) {
|
|
102
|
+
[self adjustScreenOrientation];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
- (void)viewDidAppear:(BOOL)animated {
|
|
100
107
|
[super viewDidAppear:animated];
|
|
101
108
|
[[HBDAnimationObserver sharedObserver] endAnimation];
|
|
@@ -103,16 +110,7 @@
|
|
|
103
110
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarFrameWillChange:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil];
|
|
104
111
|
}
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.016 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
|
108
|
-
UIWindowScene *windowScene = [self getWindowScene];
|
|
109
|
-
if (windowScene != nil) {
|
|
110
|
-
if (!self.forceScreenLandscape && windowScene.interfaceOrientation != UIInterfaceOrientationPortrait && ![[self hbd_mode] isEqual:@"modal"]) {
|
|
111
|
-
[self setScreenOrientation:UIInterfaceOrientationPortrait usingMask:UIInterfaceOrientationMaskPortrait];
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
113
|
+
[self adjustScreenOrientation];
|
|
116
114
|
}
|
|
117
115
|
|
|
118
116
|
- (void)viewDidDisappear:(BOOL)animated {
|
|
@@ -122,14 +120,17 @@
|
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
|
|
125
|
-
- (void)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
123
|
+
- (void)adjustScreenOrientation {
|
|
124
|
+
if (@available(iOS 15.0, *)) {
|
|
125
|
+
UIWindowScene *windowScene = [self getWindowScene];
|
|
126
|
+
if (!self.forceScreenLandscape && windowScene != nil && windowScene.interfaceOrientation != UIInterfaceOrientationPortrait && ![[self hbd_mode] isEqual:@"modal"]) {
|
|
127
|
+
[self setScreenOrientation:UIInterfaceOrientationPortrait usingMask:UIInterfaceOrientationMaskPortrait];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (self.forceScreenLandscape) {
|
|
131
|
+
[self setScreenOrientation:UIInterfaceOrientationLandscapeRight usingMask:UIInterfaceOrientationMaskLandscape];
|
|
132
|
+
}
|
|
133
|
+
}
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
- (void)setScreenOrientation:(UIInterfaceOrientation) orientation usingMask:(UIInterfaceOrientationMask) mask {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hybrid-navigation",
|
|
3
3
|
"description": "React Native Navigation that supports seamless navigation between Native and React.",
|
|
4
|
-
"version": "2.18.
|
|
4
|
+
"version": "2.18.14",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
7
7
|
"react-native": "src/index",
|
package/src/Navigator.ts
CHANGED