hybrid-navigation 2.7.8 → 2.7.11
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 2.7.11 (2022-04-13)
|
|
2
|
+
|
|
3
|
+
### Android specific
|
|
4
|
+
|
|
5
|
+
- 确保在 Activity 处于 start 状态时,才获取 `currentRoute` 和 `routeGraph`
|
|
6
|
+
|
|
7
|
+
## 2.7.10 (2022-04-12)
|
|
8
|
+
|
|
9
|
+
- 使用 `CompanentType<any>` 代替 `React.ComponentType<any>`
|
|
10
|
+
|
|
11
|
+
## 2.7.9 (2022-03-23)
|
|
12
|
+
|
|
13
|
+
### Android specific
|
|
14
|
+
|
|
15
|
+
- 修复 `Fragment is not an active fragment of FragmentManager`
|
|
16
|
+
|
|
1
17
|
## 2.7.8 (2022-03-03)
|
|
2
18
|
|
|
3
19
|
### ios specific
|
|
@@ -5,7 +21,7 @@
|
|
|
5
21
|
- 修复因 NSUInteger 导致的问题
|
|
6
22
|
|
|
7
23
|
```objc
|
|
8
|
-
for (NSUInteger i = count - 1; i > -1; i--) {
|
|
24
|
+
for (NSUInteger i = count - 1; i > -1; i--) {
|
|
9
25
|
// 无法进入此区间
|
|
10
26
|
}
|
|
11
27
|
```
|
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:12.0.
|
|
36
|
+
api 'io.github.listenzz:AndroidNavigation:12.0.8'
|
|
37
37
|
}
|
|
@@ -198,17 +198,20 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
ReactAppCompatActivity reactAppCompatActivity = (ReactAppCompatActivity) activity;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
201
|
+
reactAppCompatActivity.scheduleTaskAtStarted(() -> {
|
|
202
|
+
FragmentManager fragmentManager = reactAppCompatActivity.getSupportFragmentManager();
|
|
203
|
+
Fragment fragment = fragmentManager.findFragmentById(android.R.id.content);
|
|
204
|
+
if (fragment instanceof AwesomeFragment) {
|
|
205
|
+
String sceneId = findSceneIdByModuleName(moduleName, (AwesomeFragment) fragment);
|
|
206
|
+
FLog.i(TAG, "The sceneId found by " + moduleName + " : " + sceneId);
|
|
207
|
+
promise.resolve(sceneId);
|
|
208
|
+
} else {
|
|
209
|
+
promise.resolve(null);
|
|
210
|
+
}
|
|
211
|
+
}, true);
|
|
210
212
|
}
|
|
211
213
|
};
|
|
214
|
+
|
|
212
215
|
UiThreadUtil.runOnUiThread(task);
|
|
213
216
|
}
|
|
214
217
|
|
|
@@ -252,18 +255,20 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
252
255
|
}
|
|
253
256
|
|
|
254
257
|
ReactAppCompatActivity reactAppCompatActivity = (ReactAppCompatActivity) activity;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
258
|
+
reactAppCompatActivity.scheduleTaskAtStarted(() -> {
|
|
259
|
+
FragmentManager fragmentManager = reactAppCompatActivity.getSupportFragmentManager();
|
|
260
|
+
HybridFragment current = bridgeManager.primaryFragment(fragmentManager);
|
|
261
|
+
|
|
262
|
+
if (current != null) {
|
|
263
|
+
Bundle bundle = new Bundle();
|
|
264
|
+
bundle.putString("moduleName", current.getModuleName());
|
|
265
|
+
bundle.putString("sceneId", current.getSceneId());
|
|
266
|
+
bundle.putString("mode", Navigator.Util.getMode(current));
|
|
267
|
+
promise.resolve(Arguments.fromBundle(bundle));
|
|
268
|
+
} else {
|
|
269
|
+
UiThreadUtil.runOnUiThread(this, 16);
|
|
270
|
+
}
|
|
271
|
+
}, true);
|
|
267
272
|
}
|
|
268
273
|
};
|
|
269
274
|
|
|
@@ -287,13 +292,15 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
287
292
|
}
|
|
288
293
|
|
|
289
294
|
ReactAppCompatActivity reactAppCompatActivity = (ReactAppCompatActivity) activity;
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
reactAppCompatActivity.scheduleTaskAtStarted(() -> {
|
|
296
|
+
FragmentManager fragmentManager = reactAppCompatActivity.getSupportFragmentManager();
|
|
297
|
+
ArrayList<Bundle> graph = bridgeManager.buildRouteGraph(fragmentManager);
|
|
298
|
+
if (graph.size() > 0) {
|
|
299
|
+
promise.resolve(Arguments.fromList(graph));
|
|
300
|
+
} else {
|
|
301
|
+
UiThreadUtil.runOnUiThread(this, 16);
|
|
302
|
+
}
|
|
303
|
+
}, true);
|
|
297
304
|
}
|
|
298
305
|
};
|
|
299
306
|
|
package/docs/qa.md
CHANGED
package/lib/ReactRegistry.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export interface InjectedProps {
|
|
|
10
10
|
sceneId: string;
|
|
11
11
|
}
|
|
12
12
|
export declare const NavigationContext: React.Context<any>;
|
|
13
|
-
export declare type HOC = (WrappedComponent:
|
|
13
|
+
export declare type HOC = (WrappedComponent: ComponentType<any>) => ComponentType<any>;
|
|
14
14
|
export declare class ReactRegistry {
|
|
15
15
|
static registerEnded: boolean;
|
|
16
16
|
static startRegisterComponent(hoc?: HOC): void;
|
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.7.
|
|
4
|
+
"version": "2.7.11",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
7
7
|
"navigation",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"jest": "^27.2.0",
|
|
55
55
|
"metro-react-native-babel-preset": "^0.68.0",
|
|
56
56
|
"react": "17.0.2",
|
|
57
|
-
"react-native": "^0.67.
|
|
57
|
+
"react-native": "^0.67.4",
|
|
58
58
|
"react-native-fast-image": "^8.5.11",
|
|
59
59
|
"react-native-iphone-x-helper": "^1.2.0",
|
|
60
60
|
"react-native-keyboard-aware-scroll-view": "^0.9.5",
|
|
@@ -63,7 +63,8 @@
|
|
|
63
63
|
"react-test-renderer": "17.0.2",
|
|
64
64
|
"redux": "^4.1.1",
|
|
65
65
|
"typescript": "^4.4.3",
|
|
66
|
-
"vuepress": "^2.0.0-beta.26"
|
|
66
|
+
"vuepress": "^2.0.0-beta.26",
|
|
67
|
+
"zustand": "^3.7.1"
|
|
67
68
|
},
|
|
68
69
|
"jest": {
|
|
69
70
|
"preset": "react-native",
|