hybrid-navigation 2.18.11 → 2.18.13

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.
@@ -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.3'
36
+ api 'io.github.listenzz:AndroidNavigation:13.8.4'
37
37
  }
@@ -21,6 +21,7 @@ import com.facebook.infer.annotation.Assertions;
21
21
  import com.facebook.react.ReactInstanceManager;
22
22
  import com.facebook.react.bridge.Callback;
23
23
  import com.facebook.react.bridge.ReactContext;
24
+ import com.facebook.react.bridge.UiThreadUtil;
24
25
  import com.facebook.react.common.ReactConstants;
25
26
  import com.facebook.react.devsupport.DoubleTapReloadRecognizer;
26
27
  import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
@@ -69,11 +70,11 @@ public class ReactAppCompatActivityDelegate {
69
70
  protected ReactBridgeManager getReactBridgeManager() {
70
71
  return mBridgeManager;
71
72
  }
72
-
73
+
73
74
  public ReactInstanceManager getReactInstanceManager() {
74
75
  return mBridgeManager.getReactInstanceManager();
75
76
  }
76
-
77
+
77
78
  public ReactContext getCurrentReactContext() {
78
79
  return mBridgeManager.getCurrentReactContext();
79
80
  }
@@ -92,7 +93,7 @@ public class ReactAppCompatActivityDelegate {
92
93
  protected void onPause() {
93
94
  ReactInstanceManager reactInstanceManager = mBridgeManager.getReactInstanceManager();
94
95
  ReactContext reactContext = mBridgeManager.getCurrentReactContext();
95
- if (reactContext != null && reactInstanceManager != null) {
96
+ if (reactContext != null && reactInstanceManager != null && UiThreadUtil.isOnUiThread()) {
96
97
  reactInstanceManager.onHostPause(getPlainActivity());
97
98
  }
98
99
  }
@@ -35,263 +35,275 @@ import com.navigation.androidx.Style;
35
35
 
36
36
  public class ReactFragment extends HybridFragment implements ReactBridgeManager.ReactBridgeReloadListener {
37
37
 
38
- protected static final String TAG = "Navigation";
39
-
40
- private ViewGroup reactViewHolder;
41
-
42
- private HBDReactRootView reactRootView;
43
- private HBDReactRootView reactTitleView;
44
- private boolean firstRenderCompleted;
45
-
46
- @Nullable
47
- @Override
48
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
49
- View view = inflater.inflate(R.layout.nav_fragment_react, container, false);
50
- reactViewHolder = view.findViewById(R.id.react_content);
51
- if (isReactModuleRegisterCompleted()) {
52
- mountReactView();
53
- }
54
- return view;
55
- }
56
-
57
- @Override
58
- public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
59
- super.onViewCreated(view, savedInstanceState);
60
- // 这个时候 toolbar 才创建好
61
- initReactTitleView();
62
- }
63
-
64
- @Override
65
- protected boolean extendedLayoutIncludesToolbar() {
66
- int color = mStyle.getToolbarBackgroundColor();
67
- float alpha = mStyle.getToolbarAlpha();
68
- Garden garden = getGarden();
69
- return Color.alpha(color) < 255
70
- || alpha < 1.0
71
- || garden.toolbarHidden
72
- || garden.extendedLayoutIncludesTopBar;
73
- }
74
-
75
- @Override
76
- protected void onCustomStyle(@NonNull Style style) {
77
- super.onCustomStyle(style);
78
- if (shouldPassThroughTouches()) {
79
- style.setScrimAlpha(0);
80
- }
81
- }
82
-
83
- @Override
84
- public void onResume() {
85
- super.onResume();
86
- if (isViewReady()) {
87
- sendViewAppearEvent(true);
88
- }
89
- }
90
-
91
- @Override
92
- public void onPause() {
93
- super.onPause();
94
- if (isViewReady()) {
95
- sendViewAppearEvent(false);
96
- }
97
- }
98
-
99
- private boolean isViewReady() {
100
- if (reactRootView == null) {
101
- return false;
102
- }
103
- return firstRenderCompleted;
104
- }
105
-
106
- private boolean reactViewAppeared = false;
107
-
108
- private void sendViewAppearEvent(boolean appear) {
109
- if (!isReactModuleRegisterCompleted()) {
110
- return;
111
- }
112
-
113
- // 当从前台进入后台时,不会触发 disappear, 这和 iOS 保持一致
114
- ReactContext reactContext = getCurrentReactContext();
115
- boolean isResumed = reactContext != null && reactContext.getLifecycleState() == LifecycleState.RESUMED;
116
- if (!isResumed) {
117
- return;
118
- }
119
-
120
- if (reactViewAppeared == appear) {
121
- return;
122
- }
123
- reactViewAppeared = appear;
124
-
125
- Bundle bundle = new Bundle();
126
- bundle.putString(KEY_SCENE_ID, getSceneId());
127
- bundle.putString(KEY_ON, appear ? ON_COMPONENT_APPEAR : ON_COMPONENT_DISAPPEAR);
128
- HBDEventEmitter.sendEvent(EVENT_NAVIGATION, Arguments.fromBundle(bundle));
129
- }
130
-
131
- @Override
132
- public void onDestroyView() {
133
- super.onDestroyView();
134
- unmountReactView();
135
- }
136
-
137
- @Override
138
- public void onStart() {
139
- super.onStart();
140
- if (forceScreenLandscape()) {
141
- requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
142
- }
143
- }
144
-
145
- @SuppressLint("SourceLockedOrientationActivity")
146
- @Override
147
- public void onStop() {
148
- if (isRemoving() && forceScreenLandscape()) {
149
- Activity activity = requireActivity();
150
- activity.getWindow().getDecorView().postDelayed(() -> activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT), 10);
151
- }
152
- super.onStop();
153
- }
154
-
155
- @Override
156
- public void onReload() {
157
- unmountReactView();
158
- }
159
-
160
- private void mountReactView() {
161
- initReactRootView();
162
- getReactBridgeManager().addReactBridgeReloadListener(this);
163
- }
164
-
165
- private void unmountReactView() {
166
- getReactBridgeManager().removeReactBridgeReloadListener(this);
167
-
168
- ReactContext reactContext = getCurrentReactContext();
169
- if (reactContext == null || !reactContext.hasActiveCatalystInstance()) {
170
- return;
171
- }
172
-
173
- if (reactRootView != null) {
174
- FLog.w(TAG, "销毁页面-:" + getModuleName());
175
- reactRootView.unmountReactApplication();
176
- ViewGroup parent = (ViewGroup) reactRootView.getParent();
177
- parent.removeView(reactRootView);
178
- reactRootView = null;
179
- }
180
-
181
- if (reactTitleView != null) {
182
- reactTitleView.unmountReactApplication();
183
- ViewGroup parent = (ViewGroup) reactTitleView.getParent();
184
- parent.removeView(reactTitleView);
185
- reactTitleView = null;
186
- }
187
- }
188
-
189
- @Override
190
- protected boolean onBackPressed() {
191
- ReactInstanceManager reactInstanceManager = getReactInstanceManager();
192
- if (getShowsDialog() && reactInstanceManager != null) {
193
- reactInstanceManager.onBackPressed();
194
- return true;
195
- }
196
- return super.onBackPressed();
197
- }
198
-
199
- public void signalFirstRenderComplete() {
200
- if (firstRenderCompleted) {
201
- return;
202
- }
203
- firstRenderCompleted = true;
204
-
205
- if (isViewReady() && isResumed()) {
206
- sendViewAppearEvent(true);
207
- }
208
- }
209
-
210
- public boolean isFirstRenderCompleted() {
211
- return firstRenderCompleted;
212
- }
213
-
214
- @Override
215
- public void onFragmentResult(int requestCode, int resultCode, Bundle data) {
216
- super.onFragmentResult(requestCode, resultCode, data);
217
- Bundle result = new Bundle();
218
- result.putInt(KEY_REQUEST_CODE, requestCode);
219
- result.putInt(KEY_RESULT_CODE, resultCode);
220
- result.putBundle(KEY_RESULT_DATA, data);
221
- result.putString(KEY_SCENE_ID, getSceneId());
222
- result.putString(KEY_ON, ON_COMPONENT_RESULT);
223
- HBDEventEmitter.sendEvent(EVENT_NAVIGATION, Arguments.fromBundle(result));
224
- }
225
-
226
- @Override
227
- public void setAppProperties(@NonNull Bundle props) {
228
- super.setAppProperties(props);
229
- if (reactRootView == null) {
230
- return;
231
- }
232
-
233
- if (isReactModuleRegisterCompleted()) {
234
- reactRootView.setAppProperties(getProps());
235
- }
236
- }
237
-
238
- private void initReactRootView() {
239
- reactRootView = createReactRootView();
240
- reactRootView.startReactApplication(getReactInstanceManager(), getModuleName(), getProps());
241
- }
242
-
243
- @NonNull
244
- private HBDReactRootView createReactRootView() {
245
- HBDReactRootView reactRootView = new HBDReactRootView(getContext());
246
- reactRootView.setShouldConsumeTouchEvent(!shouldPassThroughTouches());
247
- ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT);
248
- reactViewHolder.addView(reactRootView, layoutParams);
249
- return reactRootView;
250
- }
251
-
252
- private void initReactTitleView() {
253
- if (getToolbar() == null) {
254
- return;
255
- }
256
-
257
- Bundle titleItem = getOptions().getBundle("titleItem");
258
- if (titleItem == null) {
259
- return;
260
- }
261
-
262
- String moduleName = titleItem.getString("moduleName");
263
- if (moduleName == null) {
264
- return;
265
- }
266
-
267
- if (!isReactModuleRegisterCompleted()) {
268
- throw new IllegalStateException("[Navigation] React Component 还没有注册完毕。");
269
- }
270
-
271
- String fitting = titleItem.getString("layoutFitting");
272
- boolean expanded = "expanded".equals(fitting);
273
- reactTitleView = createReactTitleView(expanded);
274
- reactTitleView.startReactApplication(getReactInstanceManager(), moduleName, getProps());
275
- }
276
-
277
- private HBDReactRootView createReactTitleView(boolean expanded) {
278
- Toolbar.LayoutParams layoutParams = createTitleLayoutParams(expanded);
279
- HBDReactRootView reactTitleView = new HBDReactRootView(getContext());
280
- Toolbar toolbar = getToolbar();
281
- toolbar.addView(reactTitleView, layoutParams);
282
- return reactTitleView;
283
- }
284
-
285
- @NonNull
286
- private Toolbar.LayoutParams createTitleLayoutParams(boolean expanded) {
287
- if (expanded) {
288
- return new Toolbar.LayoutParams(MATCH_PARENT, MATCH_PARENT, Gravity.CENTER);
289
- }
290
- return new Toolbar.LayoutParams(WRAP_CONTENT, WRAP_CONTENT, Gravity.CENTER);
291
- }
292
-
293
- @Override
294
- public String getDebugTag() {
295
- return "[" + getModuleName() + "]";
296
- }
38
+ protected static final String TAG = "Navigation";
39
+
40
+ private ViewGroup reactViewHolder;
41
+
42
+ private HBDReactRootView reactRootView;
43
+ private HBDReactRootView reactTitleView;
44
+ private boolean firstRenderCompleted;
45
+
46
+ @Nullable
47
+ @Override
48
+ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
49
+ View view = inflater.inflate(R.layout.nav_fragment_react, container, false);
50
+ reactViewHolder = view.findViewById(R.id.react_content);
51
+ if (isReactModuleRegisterCompleted()) {
52
+ mountReactView();
53
+ }
54
+ return view;
55
+ }
56
+
57
+ @Override
58
+ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
59
+ super.onViewCreated(view, savedInstanceState);
60
+ // 这个时候 toolbar 才创建好
61
+ initReactTitleView();
62
+ }
63
+
64
+ @Override
65
+ protected boolean extendedLayoutIncludesToolbar() {
66
+ int color = mStyle.getToolbarBackgroundColor();
67
+ float alpha = mStyle.getToolbarAlpha();
68
+ Garden garden = getGarden();
69
+ return Color.alpha(color) < 255 || alpha < 1.0 || garden.toolbarHidden || garden.extendedLayoutIncludesTopBar;
70
+ }
71
+
72
+ @Override
73
+ protected void onCustomStyle(@NonNull Style style) {
74
+ super.onCustomStyle(style);
75
+ if (shouldPassThroughTouches()) {
76
+ style.setScrimAlpha(0);
77
+ }
78
+ }
79
+
80
+ @SuppressLint("SourceLockedOrientationActivity")
81
+ @Override
82
+ public void onResume() {
83
+ super.onResume();
84
+ if (isViewReady()) {
85
+ sendViewAppearEvent(true);
86
+ }
87
+
88
+ if (!forceScreenLandscape() &&
89
+ !Navigator.MODE_MODAL.equals(Navigator.Util.getMode(this)) &&
90
+ requireActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
91
+ requireView().clearAnimation();
92
+ requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
93
+ }
94
+
95
+ if (forceScreenLandscape()) {
96
+ requireView().clearAnimation();
97
+ requireActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
98
+ }
99
+ }
100
+
101
+ @Override
102
+ public void onPause() {
103
+ super.onPause();
104
+ if (isViewReady()) {
105
+ sendViewAppearEvent(false);
106
+ }
107
+ }
108
+
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();
127
+ }
128
+
129
+ private boolean isViewReady() {
130
+ if (reactRootView == null) {
131
+ return false;
132
+ }
133
+ return firstRenderCompleted;
134
+ }
135
+
136
+ private boolean reactViewAppeared = false;
137
+
138
+ private void sendViewAppearEvent(boolean appear) {
139
+ if (!isReactModuleRegisterCompleted()) {
140
+ return;
141
+ }
142
+
143
+ // 当从前台进入后台时,不会触发 disappear, 这和 iOS 保持一致
144
+ ReactContext reactContext = getCurrentReactContext();
145
+ boolean isResumed = reactContext != null && reactContext.getLifecycleState() == LifecycleState.RESUMED;
146
+ if (!isResumed) {
147
+ return;
148
+ }
149
+
150
+ if (reactViewAppeared == appear) {
151
+ return;
152
+ }
153
+ reactViewAppeared = appear;
154
+
155
+ Bundle bundle = new Bundle();
156
+ bundle.putString(KEY_SCENE_ID, getSceneId());
157
+ bundle.putString(KEY_ON, appear ? ON_COMPONENT_APPEAR : ON_COMPONENT_DISAPPEAR);
158
+ HBDEventEmitter.sendEvent(EVENT_NAVIGATION, Arguments.fromBundle(bundle));
159
+ }
160
+
161
+ @Override
162
+ public void onDestroyView() {
163
+ super.onDestroyView();
164
+ unmountReactView();
165
+ }
166
+
167
+ @Override
168
+ public void onReload() {
169
+ unmountReactView();
170
+ }
171
+
172
+ private void mountReactView() {
173
+ initReactRootView();
174
+ getReactBridgeManager().addReactBridgeReloadListener(this);
175
+ }
176
+
177
+ private void unmountReactView() {
178
+ getReactBridgeManager().removeReactBridgeReloadListener(this);
179
+
180
+ ReactContext reactContext = getCurrentReactContext();
181
+ if (reactContext == null || !reactContext.hasActiveCatalystInstance()) {
182
+ return;
183
+ }
184
+
185
+ if (reactRootView != null) {
186
+ FLog.w(TAG, "销毁页面-:" + getModuleName());
187
+ reactRootView.unmountReactApplication();
188
+ ViewGroup parent = (ViewGroup) reactRootView.getParent();
189
+ parent.removeView(reactRootView);
190
+ reactRootView = null;
191
+ }
192
+
193
+ if (reactTitleView != null) {
194
+ reactTitleView.unmountReactApplication();
195
+ ViewGroup parent = (ViewGroup) reactTitleView.getParent();
196
+ parent.removeView(reactTitleView);
197
+ reactTitleView = null;
198
+ }
199
+ }
200
+
201
+ @Override
202
+ protected boolean onBackPressed() {
203
+ ReactInstanceManager reactInstanceManager = getReactInstanceManager();
204
+ if (getShowsDialog() && reactInstanceManager != null) {
205
+ reactInstanceManager.onBackPressed();
206
+ return true;
207
+ }
208
+ return super.onBackPressed();
209
+ }
210
+
211
+ public void signalFirstRenderComplete() {
212
+ if (firstRenderCompleted) {
213
+ return;
214
+ }
215
+ firstRenderCompleted = true;
216
+
217
+ if (isViewReady() && isResumed()) {
218
+ sendViewAppearEvent(true);
219
+ }
220
+ }
221
+
222
+ public boolean isFirstRenderCompleted() {
223
+ return firstRenderCompleted;
224
+ }
225
+
226
+ @Override
227
+ public void onFragmentResult(int requestCode, int resultCode, Bundle data) {
228
+ super.onFragmentResult(requestCode, resultCode, data);
229
+ Bundle result = new Bundle();
230
+ result.putInt(KEY_REQUEST_CODE, requestCode);
231
+ result.putInt(KEY_RESULT_CODE, resultCode);
232
+ result.putBundle(KEY_RESULT_DATA, data);
233
+ result.putString(KEY_SCENE_ID, getSceneId());
234
+ result.putString(KEY_ON, ON_COMPONENT_RESULT);
235
+ HBDEventEmitter.sendEvent(EVENT_NAVIGATION, Arguments.fromBundle(result));
236
+ }
237
+
238
+ @Override
239
+ public void setAppProperties(@NonNull Bundle props) {
240
+ super.setAppProperties(props);
241
+ if (reactRootView == null) {
242
+ return;
243
+ }
244
+
245
+ if (isReactModuleRegisterCompleted()) {
246
+ reactRootView.setAppProperties(getProps());
247
+ }
248
+ }
249
+
250
+ private void initReactRootView() {
251
+ reactRootView = createReactRootView();
252
+ reactRootView.startReactApplication(getReactInstanceManager(), getModuleName(), getProps());
253
+ }
254
+
255
+ @NonNull
256
+ private HBDReactRootView createReactRootView() {
257
+ HBDReactRootView reactRootView = new HBDReactRootView(getContext());
258
+ reactRootView.setShouldConsumeTouchEvent(!shouldPassThroughTouches());
259
+ ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT);
260
+ reactViewHolder.addView(reactRootView, layoutParams);
261
+ return reactRootView;
262
+ }
263
+
264
+ private void initReactTitleView() {
265
+ if (getToolbar() == null) {
266
+ return;
267
+ }
268
+
269
+ Bundle titleItem = getOptions().getBundle("titleItem");
270
+ if (titleItem == null) {
271
+ return;
272
+ }
273
+
274
+ String moduleName = titleItem.getString("moduleName");
275
+ if (moduleName == null) {
276
+ return;
277
+ }
278
+
279
+ if (!isReactModuleRegisterCompleted()) {
280
+ throw new IllegalStateException("[Navigation] React Component 还没有注册完毕。");
281
+ }
282
+
283
+ String fitting = titleItem.getString("layoutFitting");
284
+ boolean expanded = "expanded".equals(fitting);
285
+ reactTitleView = createReactTitleView(expanded);
286
+ reactTitleView.startReactApplication(getReactInstanceManager(), moduleName, getProps());
287
+ }
288
+
289
+ private HBDReactRootView createReactTitleView(boolean expanded) {
290
+ Toolbar.LayoutParams layoutParams = createTitleLayoutParams(expanded);
291
+ HBDReactRootView reactTitleView = new HBDReactRootView(getContext());
292
+ Toolbar toolbar = getToolbar();
293
+ toolbar.addView(reactTitleView, layoutParams);
294
+ return reactTitleView;
295
+ }
296
+
297
+ @NonNull
298
+ private Toolbar.LayoutParams createTitleLayoutParams(boolean expanded) {
299
+ if (expanded) {
300
+ return new Toolbar.LayoutParams(MATCH_PARENT, MATCH_PARENT, Gravity.CENTER);
301
+ }
302
+ return new Toolbar.LayoutParams(WRAP_CONTENT, WRAP_CONTENT, Gravity.CENTER);
303
+ }
304
+
305
+ @Override
306
+ public String getDebugTag() {
307
+ return "[" + getModuleName() + "]";
308
+ }
297
309
  }
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,12 +96,21 @@
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];
102
109
  if (![HBDUtils isIphoneX]) {
103
110
  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(statusBarFrameWillChange:) name:UIApplicationWillChangeStatusBarFrameNotification object:nil];
104
111
  }
112
+
113
+ [self adjustScreenOrientation];
105
114
  }
106
115
 
107
116
  - (void)viewDidDisappear:(BOOL)animated {
@@ -111,6 +120,19 @@
111
120
  }
112
121
  }
113
122
 
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
+ }
134
+ }
135
+
114
136
  - (void)willMoveToParentViewController:(UIViewController *)parent {
115
137
  if (self.forceScreenLandscape) {
116
138
  if (parent) {
@@ -123,7 +145,6 @@
123
145
 
124
146
  - (void)setScreenOrientation:(UIInterfaceOrientation) orientation usingMask:(UIInterfaceOrientationMask) mask {
125
147
  [GlobalStyle globalStyle].interfaceOrientation = mask;
126
-
127
148
  if (@available(iOS 16.0, *)) {
128
149
  UIWindowScene *windowScene = [self getWindowScene];
129
150
  if (windowScene != nil) {
@@ -145,7 +166,7 @@
145
166
  [UIViewController attemptRotationToDeviceOrientation];
146
167
  }
147
168
 
148
- - (UIWindowScene *)getWindowScene API_AVAILABLE(ios(13.0)){
169
+ - (UIWindowScene *)getWindowScene API_AVAILABLE(ios(13.0)){
149
170
  NSArray *array = [[[UIApplication sharedApplication] connectedScenes] allObjects];
150
171
  for (id connectedScene in array) {
151
172
  if ([connectedScene isKindOfClass:[UIWindowScene class]]) {
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.11",
4
+ "version": "2.18.13",
5
5
  "main": "./dist/index.js",
6
6
  "typings": "./dist/index.d.ts",
7
7
  "react-native": "src/index",
package/src/Navigator.ts CHANGED
@@ -106,6 +106,7 @@ export class Navigator implements Navigator {
106
106
  moduleName,
107
107
  inclusive,
108
108
  from: this.moduleName,
109
+ to: moduleName,
109
110
  });
110
111
 
111
112
  popToRoot = () => Navigation.dispatch(this.sceneId, 'popToRoot', {from: this.moduleName});