hybrid-navigation 2.18.13 → 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.
@@ -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;
@@ -93,7 +94,6 @@ public class ReactFragment extends HybridFragment implements ReactBridgeManager.
93
94
  }
94
95
 
95
96
  if (forceScreenLandscape()) {
96
- requireView().clearAnimation();
97
97
  requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
98
98
  }
99
99
  }
@@ -107,23 +107,10 @@ public class ReactFragment extends HybridFragment implements ReactBridgeManager.
107
107
  }
108
108
 
109
109
  @Override
110
- public void onStart() {
111
- super.onStart();
112
- if (forceScreenLandscape()) {
113
- requireView().clearAnimation();
114
- requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
115
- }
116
- }
117
-
118
- @SuppressLint("SourceLockedOrientationActivity")
119
- @Override
120
- public void onStop() {
121
- if (isRemoving() && forceScreenLandscape()) {
122
- Activity activity = requireActivity();
123
- activity.getWindow().getDecorView().postDelayed(() ->
124
- activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT), 16);
125
- }
126
- super.onStop();
110
+ public void onConfigurationChanged(@NonNull Configuration newConfig) {
111
+ super.onConfigurationChanged(newConfig);
112
+ // 避免屏幕旋转时状态栏样式不更新的问题
113
+ setNeedsStatusBarAppearanceUpdate();
127
114
  }
128
115
 
129
116
  private boolean isViewReady() {
@@ -123,7 +123,7 @@
123
123
  - (void)adjustScreenOrientation {
124
124
  if (@available(iOS 15.0, *)) {
125
125
  UIWindowScene *windowScene = [self getWindowScene];
126
- if (!self.forceScreenLandscape && windowScene != nil && windowScene.interfaceOrientation != UIInterfaceOrientationPortrait && ![[self hbd_mode] isEqual:@"modal"]) {
126
+ if (!self.forceScreenLandscape && windowScene != nil && windowScene.interfaceOrientation != UIInterfaceOrientationPortrait && ![[self hbd_mode] isEqual:@"modal"]) {
127
127
  [self setScreenOrientation:UIInterfaceOrientationPortrait usingMask:UIInterfaceOrientationMaskPortrait];
128
128
  }
129
129
 
@@ -133,16 +133,6 @@
133
133
  }
134
134
  }
135
135
 
136
- - (void)willMoveToParentViewController:(UIViewController *)parent {
137
- if (self.forceScreenLandscape) {
138
- if (parent) {
139
- [self setScreenOrientation:UIInterfaceOrientationLandscapeRight usingMask:UIInterfaceOrientationMaskLandscape];
140
- } else {
141
- [self setScreenOrientation:UIInterfaceOrientationPortrait usingMask:UIInterfaceOrientationMaskPortrait];
142
- }
143
- }
144
- }
145
-
146
136
  - (void)setScreenOrientation:(UIInterfaceOrientation) orientation usingMask:(UIInterfaceOrientationMask) mask {
147
137
  [GlobalStyle globalStyle].interfaceOrientation = mask;
148
138
  if (@available(iOS 16.0, *)) {
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.13",
4
+ "version": "2.18.14",
5
5
  "main": "./dist/index.js",
6
6
  "typings": "./dist/index.d.ts",
7
7
  "react-native": "src/index",