hybrid-navigation 2.18.14 → 2.20.0
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/build.gradle +1 -1
- package/android/src/main/java/com/reactnative/hybridnavigation/Garden.java +4 -9
- package/android/src/main/java/com/reactnative/hybridnavigation/GlobalStyle.java +4 -12
- package/android/src/main/java/com/reactnative/hybridnavigation/ReactFragment.java +8 -1
- package/dist/Options.d.ts +0 -2
- package/package.json +1 -1
- package/src/Options.ts +1 -6
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.10.0'
|
|
37
37
|
}
|
|
@@ -64,7 +64,7 @@ public class Garden {
|
|
|
64
64
|
boolean extendedLayoutIncludesTopBar;
|
|
65
65
|
|
|
66
66
|
boolean forceTransparentDialogWindow;
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
Garden(@NonNull HybridFragment fragment, Style style) {
|
|
69
69
|
// 构造 garden 实例时,Toolbar 还没有被创建
|
|
70
70
|
|
|
@@ -79,12 +79,12 @@ public class Garden {
|
|
|
79
79
|
Bundle tabItem = options.getBundle("tabItem");
|
|
80
80
|
this.hidesBottomBarWhenPushed = tabItem == null || tabItem.getBoolean("hideTabBarWhenPush", true);
|
|
81
81
|
this.extendedLayoutIncludesTopBar = options.getBoolean("extendedLayoutIncludesTopBar", false);
|
|
82
|
-
|
|
82
|
+
|
|
83
83
|
if (options.get("fitsOpaqueNavigationBarAndroid") != null) {
|
|
84
84
|
boolean fitsOpaqueNavigationBar = options.getBoolean("fitsOpaqueNavigationBarAndroid");
|
|
85
85
|
style.setFitsOpaqueNavigationBar(fitsOpaqueNavigationBar);
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
|
|
88
88
|
String screenColor = options.getString("screenBackgroundColor");
|
|
89
89
|
if (!TextUtils.isEmpty(screenColor)) {
|
|
90
90
|
style.setScreenBackgroundColor(Color.parseColor(screenColor));
|
|
@@ -217,11 +217,6 @@ public class Garden {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
String statusBarColor = options.getString("statusBarColorAndroid");
|
|
221
|
-
if (!TextUtils.isEmpty(statusBarColor)) {
|
|
222
|
-
style.setStatusBarColor(Color.parseColor(statusBarColor));
|
|
223
|
-
}
|
|
224
|
-
|
|
225
220
|
String navigationBarColor = options.getString("navigationBarColorAndroid");
|
|
226
221
|
if (!TextUtils.isEmpty(navigationBarColor)) {
|
|
227
222
|
style.setNavigationBarColor(Color.parseColor(navigationBarColor));
|
|
@@ -329,7 +324,7 @@ public class Garden {
|
|
|
329
324
|
}
|
|
330
325
|
|
|
331
326
|
private boolean shouldUpdateStatusBar(@NonNull ReadableMap readableMap) {
|
|
332
|
-
String[] keys = new String[]{"topBarStyle", "
|
|
327
|
+
String[] keys = new String[]{"topBarStyle", "statusBarHidden", "topBarColor", "displayCutoutWhenLandscapeAndroid"};
|
|
333
328
|
for (String key : keys) {
|
|
334
329
|
if (readableMap.hasKey(key)) {
|
|
335
330
|
return true;
|
|
@@ -31,7 +31,7 @@ public class GlobalStyle {
|
|
|
31
31
|
public GlobalStyle(Bundle options) {
|
|
32
32
|
this.options = options;
|
|
33
33
|
}
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
public void inflateStyle(Context context, Style style) {
|
|
36
36
|
if (options == null) {
|
|
37
37
|
FLog.w(TAG, "Style options is null");
|
|
@@ -80,15 +80,7 @@ public class GlobalStyle {
|
|
|
80
80
|
style.setToolbarBackgroundColorLightContent(Color.parseColor(topBarColorLightContent));
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
//
|
|
84
|
-
String statusBarColor = options.getString("statusBarColorAndroid");
|
|
85
|
-
if (statusBarColor != null) {
|
|
86
|
-
style.setStatusBarColor(Color.parseColor(statusBarColor));
|
|
87
|
-
} else {
|
|
88
|
-
style.setStatusBarColor(Color.TRANSPARENT);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
//
|
|
83
|
+
//
|
|
92
84
|
boolean displayCutout = options.getBoolean("displayCutoutWhenLandscapeAndroid", true);
|
|
93
85
|
style.setDisplayCutoutWhenLandscape(displayCutout);
|
|
94
86
|
|
|
@@ -210,11 +202,11 @@ public class GlobalStyle {
|
|
|
210
202
|
if (scrimAlpha != -1) {
|
|
211
203
|
style.setScrimAlpha((int) scrimAlpha);
|
|
212
204
|
}
|
|
213
|
-
|
|
205
|
+
|
|
214
206
|
// fitsOpaqueNavigationBarAndroid
|
|
215
207
|
boolean fitsOpaqueNavigationBar = options.getBoolean("fitsOpaqueNavigationBarAndroid", true);
|
|
216
208
|
style.setFitsOpaqueNavigationBar(fitsOpaqueNavigationBar);
|
|
217
|
-
|
|
209
|
+
|
|
218
210
|
}
|
|
219
211
|
|
|
220
212
|
private void setBarBarShadowImage(@NonNull Context context, @NonNull Style style, @NonNull Bundle shadowImage) {
|
|
@@ -13,7 +13,6 @@ import static com.reactnative.hybridnavigation.HBDEventEmitter.ON_COMPONENT_DISA
|
|
|
13
13
|
import static com.reactnative.hybridnavigation.HBDEventEmitter.ON_COMPONENT_RESULT;
|
|
14
14
|
|
|
15
15
|
import android.annotation.SuppressLint;
|
|
16
|
-
import android.app.Activity;
|
|
17
16
|
import android.content.pm.ActivityInfo;
|
|
18
17
|
import android.content.res.Configuration;
|
|
19
18
|
import android.graphics.Color;
|
|
@@ -62,6 +61,14 @@ public class ReactFragment extends HybridFragment implements ReactBridgeManager.
|
|
|
62
61
|
initReactTitleView();
|
|
63
62
|
}
|
|
64
63
|
|
|
64
|
+
@Override
|
|
65
|
+
public void onStop() {
|
|
66
|
+
super.onStop();
|
|
67
|
+
if (isRemoving() && forceScreenLandscape()) {
|
|
68
|
+
unmountReactView();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
65
72
|
@Override
|
|
66
73
|
protected boolean extendedLayoutIncludesToolbar() {
|
|
67
74
|
int color = mStyle.getToolbarBackgroundColor();
|
package/dist/Options.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ export type LayoutFitting = LayoutFittingExpanded | LayoutFittingCompressed;
|
|
|
25
25
|
export interface NavigationOption {
|
|
26
26
|
screenBackgroundColor?: Color;
|
|
27
27
|
statusBarHidden?: boolean;
|
|
28
|
-
statusBarColorAndroid?: Color;
|
|
29
28
|
topBarStyle?: BarStyle;
|
|
30
29
|
topBarColor?: Color;
|
|
31
30
|
topBarShadowHidden?: boolean;
|
|
@@ -91,7 +90,6 @@ export interface DefaultOptions {
|
|
|
91
90
|
topBarColor?: Color;
|
|
92
91
|
topBarColorDarkContent?: Color;
|
|
93
92
|
topBarColorLightContent?: Color;
|
|
94
|
-
statusBarColorAndroid?: Color;
|
|
95
93
|
navigationBarColorAndroid?: Color;
|
|
96
94
|
hideBackTitleIOS?: boolean;
|
|
97
95
|
elevationAndroid?: number;
|
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.
|
|
4
|
+
"version": "2.20.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"typings": "./dist/index.d.ts",
|
|
7
7
|
"react-native": "src/index",
|
package/src/Options.ts
CHANGED
|
@@ -29,7 +29,6 @@ export type LayoutFitting = LayoutFittingExpanded | LayoutFittingCompressed;
|
|
|
29
29
|
export interface NavigationOption {
|
|
30
30
|
screenBackgroundColor?: Color; // 页面背景,默认是白色
|
|
31
31
|
statusBarHidden?: boolean; // 是否隐藏状态栏
|
|
32
|
-
statusBarColorAndroid?: Color; // 状态栏背景颜色
|
|
33
32
|
topBarStyle?: BarStyle; // TopBar 样式,决定了状态栏的颜色,可选项有 `BarStyleLightContent` 和 `BarStyleDarkContent`
|
|
34
33
|
topBarColor?: Color; // TopBar 背景颜色
|
|
35
34
|
topBarShadowHidden?: boolean; // 是否隐藏 TopBar 的阴影
|
|
@@ -103,7 +102,6 @@ export interface DefaultOptions {
|
|
|
103
102
|
topBarColor?: Color; // TopBar 背景颜色,默认根据 topBarStyle 来计算
|
|
104
103
|
topBarColorDarkContent?: Color; // TopBar 背景颜色,当 topBarStyle 的值为 BarStyleDarkContent 时生效,覆盖 topBarColor 的值
|
|
105
104
|
topBarColorLightContent?: Color; // TopBar 背景颜色,当 topBarStyle 的值为 BarStyleLightContent 时生效,覆盖 topBarColor 的值
|
|
106
|
-
statusBarColorAndroid?: Color; // 状态栏背景颜色,默认取 topBarColor 的值
|
|
107
105
|
navigationBarColorAndroid?: Color; // 底部虚拟键背景颜色,仅对 Android 8.0 以上版本生效
|
|
108
106
|
hideBackTitleIOS?: boolean; // 是否隐藏返回按钮旁边的文字,默认是 false, 仅对 iOS 生效
|
|
109
107
|
elevationAndroid?: number; // TopBar 阴影高度,默认值为 4 dp
|
|
@@ -133,10 +131,7 @@ export interface DefaultOptions {
|
|
|
133
131
|
|
|
134
132
|
export type TabBarStyle = Pick<
|
|
135
133
|
DefaultOptions,
|
|
136
|
-
| '
|
|
137
|
-
| 'tabBarShadowImage'
|
|
138
|
-
| 'tabBarItemColor'
|
|
139
|
-
| 'tabBarUnselectedItemColor'
|
|
134
|
+
'tabBarColor' | 'tabBarShadowImage' | 'tabBarItemColor' | 'tabBarUnselectedItemColor'
|
|
140
135
|
>;
|
|
141
136
|
|
|
142
137
|
export interface TabItemInfo {
|