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