hybrid-navigation 2.14.0 → 2.14.1
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/README.md +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnative/hybridnavigation/GardenModule.java +1 -1
- package/android/src/main/java/com/reactnative/hybridnavigation/NavigationModule.java +2 -2
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactFragment.java +7 -3
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactTabBar.java +8 -0
- package/android/src/main/res/layout/nav_tab_bar_react.xml +9 -4
- package/android/src/main/res/layout/nav_tab_bar_react_indeterminate.xml +9 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ React Native Navigation that supports seamless navigation between Native and Rea
|
|
|
7
7
|
- 使用原生导航组件实现 React Native 页面间的导航,不仅具有更优的性能,而且使得 RN 页面具有原生质感
|
|
8
8
|
- 原生页面和 RN 页面共享路由, 使得它们之间相互跳转和传值轻而易举
|
|
9
9
|
- 内置 drawer, tabs, stack 标准容器,同时支持自定义容器和导航
|
|
10
|
-
- 支持
|
|
10
|
+
- 支持 Deep Link
|
|
11
11
|
|
|
12
12
|

|
|
13
13
|
|
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.
|
|
36
|
+
api 'io.github.listenzz:AndroidNavigation:13.1.0'
|
|
37
37
|
}
|
|
@@ -208,7 +208,7 @@ public class GardenModule extends ReactContextBaseJavaModule {
|
|
|
208
208
|
@Nullable
|
|
209
209
|
private ReactAppCompatActivity getActiveActivity() {
|
|
210
210
|
ReactContext reactContext = getReactApplicationContext();
|
|
211
|
-
if (reactContext == null || !reactContext.
|
|
211
|
+
if (reactContext == null || !reactContext.hasActiveCatalystInstance()) {
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -106,7 +106,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
106
106
|
public void setRoot(final ReadableMap layout, final boolean sticky, final Callback callback) {
|
|
107
107
|
UiThreadUtil.runOnUiThread(() -> {
|
|
108
108
|
ReactContext reactContext = getReactApplicationContext();
|
|
109
|
-
if (reactContext == null || !reactContext.
|
|
109
|
+
if (reactContext == null || !reactContext.hasActiveCatalystInstance()) {
|
|
110
110
|
FLog.w(TAG, "ReactContext hasn't active CatalystInstance, skip action `setRoot`");
|
|
111
111
|
return;
|
|
112
112
|
}
|
|
@@ -353,7 +353,7 @@ public class NavigationModule extends ReactContextBaseJavaModule {
|
|
|
353
353
|
@Nullable
|
|
354
354
|
private ReactAppCompatActivity getActiveActivity() {
|
|
355
355
|
ReactContext reactContext = getReactApplicationContext();
|
|
356
|
-
if (reactContext == null || !reactContext.
|
|
356
|
+
if (reactContext == null || !reactContext.hasActiveCatalystInstance()) {
|
|
357
357
|
return null;
|
|
358
358
|
}
|
|
359
359
|
|
|
@@ -48,7 +48,7 @@ public class ReactFragment extends HybridFragment implements ReactRootViewHolder
|
|
|
48
48
|
reactRootViewHolder = (ReactRootViewHolder) containerLayout;
|
|
49
49
|
reactRootViewHolder.setVisibilityObserver(this);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
|
|
52
52
|
if (!FragmentHelper.isHidden(this) || getShowsDialog()) {
|
|
53
53
|
initReactRootView();
|
|
54
54
|
}
|
|
@@ -197,7 +197,7 @@ public class ReactFragment extends HybridFragment implements ReactRootViewHolder
|
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
199
|
firstRenderCompleted = true;
|
|
200
|
-
|
|
200
|
+
|
|
201
201
|
if (isViewReady() && isResumed()) {
|
|
202
202
|
sendViewAppearEvent(true);
|
|
203
203
|
reactRootView.addOnGlobalLayoutListener();
|
|
@@ -296,5 +296,9 @@ public class ReactFragment extends HybridFragment implements ReactRootViewHolder
|
|
|
296
296
|
}
|
|
297
297
|
return new Toolbar.LayoutParams(WRAP_CONTENT, WRAP_CONTENT, Gravity.CENTER);
|
|
298
298
|
}
|
|
299
|
-
|
|
299
|
+
|
|
300
|
+
@Override
|
|
301
|
+
public String getDebugTag() {
|
|
302
|
+
return "[" + getModuleName() + "]";
|
|
303
|
+
}
|
|
300
304
|
}
|
|
@@ -67,6 +67,14 @@ public class ReactTabBar extends FrameLayout {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
@Override
|
|
71
|
+
public void setPadding(int left, int top, int right, int bottom) {
|
|
72
|
+
mBackgroundView.setPadding(left, top, right, bottom);
|
|
73
|
+
if (mSizeIndeterminate) {
|
|
74
|
+
mReactHolder.setPadding(left, top, right, bottom);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
70
78
|
public void setRootView(View rootView) {
|
|
71
79
|
mReactHolder.addView(rootView);
|
|
72
80
|
}
|
|
@@ -7,20 +7,25 @@
|
|
|
7
7
|
<FrameLayout
|
|
8
8
|
android:id="@+id/bottom_navigation_bar_background"
|
|
9
9
|
android:layout_width="match_parent"
|
|
10
|
-
android:
|
|
11
|
-
android:
|
|
12
|
-
|
|
10
|
+
android:layout_height="wrap_content"
|
|
11
|
+
android:layout_gravity="bottom">
|
|
13
12
|
<View
|
|
14
13
|
android:id="@+id/bottom_navigation_bar_divider"
|
|
15
14
|
android:layout_width="match_parent"
|
|
16
15
|
android:layout_height="1dp"
|
|
17
16
|
android:layout_gravity="top" />
|
|
17
|
+
|
|
18
|
+
<View
|
|
19
|
+
android:layout_width="match_parent"
|
|
20
|
+
android:layout_height="@dimen/nav_tab_bar_height"
|
|
21
|
+
android:layout_gravity="bottom" />
|
|
22
|
+
|
|
18
23
|
</FrameLayout>
|
|
19
24
|
|
|
20
25
|
<FrameLayout
|
|
21
26
|
android:id="@+id/bottom_navigation_bar_react_holder"
|
|
22
27
|
android:layout_width="match_parent"
|
|
23
28
|
android:layout_height="@dimen/nav_tab_bar_height"
|
|
24
|
-
android:layout_gravity="
|
|
29
|
+
android:layout_gravity="top" />
|
|
25
30
|
|
|
26
31
|
</FrameLayout>
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
android:id="@+id/bottom_navigation_bar_container"
|
|
4
4
|
android:layout_width="match_parent"
|
|
5
5
|
android:layout_height="wrap_content">
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
<FrameLayout
|
|
8
8
|
android:id="@+id/bottom_navigation_bar_background"
|
|
9
9
|
android:layout_width="match_parent"
|
|
10
|
-
android:layout_height="
|
|
10
|
+
android:layout_height="wrap_content"
|
|
11
11
|
android:layout_gravity="bottom">
|
|
12
12
|
|
|
13
13
|
<View
|
|
@@ -15,11 +15,17 @@
|
|
|
15
15
|
android:layout_width="match_parent"
|
|
16
16
|
android:layout_height="1dp"
|
|
17
17
|
android:layout_gravity="top" />
|
|
18
|
+
|
|
19
|
+
<View
|
|
20
|
+
android:layout_width="match_parent"
|
|
21
|
+
android:layout_height="@dimen/nav_tab_bar_height"
|
|
22
|
+
android:layout_gravity="bottom" />
|
|
18
23
|
</FrameLayout>
|
|
19
24
|
|
|
20
25
|
<FrameLayout
|
|
21
26
|
android:id="@+id/bottom_navigation_bar_react_holder"
|
|
22
27
|
android:layout_width="match_parent"
|
|
23
28
|
android:layout_height="wrap_content"
|
|
24
|
-
android:layout_gravity="
|
|
29
|
+
android:layout_gravity="top" />
|
|
30
|
+
|
|
25
31
|
</FrameLayout>
|
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.14.
|
|
4
|
+
"version": "2.14.1",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"typings": "./lib/index.d.ts",
|
|
7
7
|
"react-native": "src/index",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "rm -rf ./lib && tsc -p tsconfig.build.json",
|
|
36
36
|
"prepare": "npm run build",
|
|
37
|
-
"start": "react-native start --reset-cache",
|
|
37
|
+
"start": "watchman watch-del-all && react-native start --reset-cache",
|
|
38
38
|
"android": "react-native run-android",
|
|
39
39
|
"ios": "react-native run-ios",
|
|
40
40
|
"test": "jest",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"react": "18.2.0",
|
|
67
67
|
"react-native": "^0.71.0",
|
|
68
68
|
"react-native-fast-image": "^8.5.11",
|
|
69
|
-
"react-native-keyboard-insets": "^1.
|
|
69
|
+
"react-native-keyboard-insets": "^1.1.0",
|
|
70
70
|
"react-native-safe-area-context": "^4.5.0",
|
|
71
71
|
"react-native-toast-hybrid": "^2.5.0",
|
|
72
72
|
"react-redux": "^7.2.5",
|