|
@@ -8,6 +8,7 @@ import com.reactnativenavigation.parse.params.NullNumber;
|
8
|
8
|
import com.reactnativenavigation.parse.params.NullText;
|
9
|
9
|
import com.reactnativenavigation.parse.params.Number;
|
10
|
10
|
import com.reactnativenavigation.parse.params.Text;
|
|
11
|
+import com.reactnativenavigation.parse.params.TitleDisplayMode;
|
11
|
12
|
import com.reactnativenavigation.parse.parsers.BoolParser;
|
12
|
13
|
import com.reactnativenavigation.parse.parsers.ColorParser;
|
13
|
14
|
import com.reactnativenavigation.parse.parsers.NumberParser;
|
|
@@ -30,6 +31,7 @@ public class BottomTabsOptions {
|
30
|
31
|
options.drawBehind = BoolParser.parse(json, "drawBehind");
|
31
|
32
|
options.animate = BoolParser.parse(json,"animate");
|
32
|
33
|
options.testId = TextParser.parse(json, "testID");
|
|
34
|
+ options.titleDisplayMode = TitleDisplayMode.fromString(json.optString("titleDisplayMode"));
|
33
|
35
|
|
34
|
36
|
return options;
|
35
|
37
|
}
|
|
@@ -43,61 +45,30 @@ public class BottomTabsOptions {
|
43
|
45
|
public Number currentTabIndex = new NullNumber();
|
44
|
46
|
public Text currentTabId = new NullText();
|
45
|
47
|
public Text testId = new NullText();
|
|
48
|
+ public TitleDisplayMode titleDisplayMode = TitleDisplayMode.UNDEFINED;
|
46
|
49
|
|
47
|
50
|
void mergeWith(final BottomTabsOptions other) {
|
48
|
|
- if (other.currentTabId.hasValue()) {
|
49
|
|
- currentTabId = other.currentTabId;
|
50
|
|
- }
|
51
|
|
- if (other.currentTabIndex.hasValue()) {
|
52
|
|
- currentTabIndex = other.currentTabIndex;
|
53
|
|
- }
|
54
|
|
- if (other.visible.hasValue()) {
|
55
|
|
- visible = other.visible;
|
56
|
|
- }
|
57
|
|
- if (other.drawBehind.hasValue()) {
|
58
|
|
- drawBehind = other.drawBehind;
|
59
|
|
- }
|
60
|
|
- if (other.animate.hasValue()) {
|
61
|
|
- animate = other.animate;
|
62
|
|
- }
|
63
|
|
- if (other.tabColor.hasValue()) {
|
64
|
|
- tabColor = other.tabColor;
|
65
|
|
- }
|
66
|
|
- if (other.selectedTabColor.hasValue()) {
|
67
|
|
- selectedTabColor = other.selectedTabColor;
|
68
|
|
- }
|
69
|
|
- if (other.backgroundColor.hasValue()) {
|
70
|
|
- backgroundColor = other.backgroundColor;
|
71
|
|
- }
|
72
|
|
- if (other.testId.hasValue()) {
|
73
|
|
- testId = other.testId;
|
74
|
|
- }
|
|
51
|
+ if (other.currentTabId.hasValue()) currentTabId = other.currentTabId;
|
|
52
|
+ if (other.currentTabIndex.hasValue()) currentTabIndex = other.currentTabIndex;
|
|
53
|
+ if (other.visible.hasValue()) visible = other.visible;
|
|
54
|
+ if (other.drawBehind.hasValue()) drawBehind = other.drawBehind;
|
|
55
|
+ if (other.animate.hasValue()) animate = other.animate;
|
|
56
|
+ if (other.tabColor.hasValue()) tabColor = other.tabColor;
|
|
57
|
+ if (other.selectedTabColor.hasValue()) selectedTabColor = other.selectedTabColor;
|
|
58
|
+ if (other.backgroundColor.hasValue()) backgroundColor = other.backgroundColor;
|
|
59
|
+ if (other.testId.hasValue()) testId = other.testId;
|
|
60
|
+ if (other.titleDisplayMode.hasValue()) titleDisplayMode = other.titleDisplayMode;
|
75
|
61
|
}
|
76
|
62
|
|
77
|
63
|
void mergeWithDefault(final BottomTabsOptions defaultOptions) {
|
78
|
|
- if (!currentTabId.hasValue()) {
|
79
|
|
- currentTabId = defaultOptions.currentTabId;
|
80
|
|
- }
|
81
|
|
- if (!currentTabIndex.hasValue()) {
|
82
|
|
- currentTabIndex = defaultOptions.currentTabIndex;
|
83
|
|
- }
|
84
|
|
- if (!visible.hasValue()) {
|
85
|
|
- visible = defaultOptions.visible;
|
86
|
|
- }
|
87
|
|
- if (!drawBehind.hasValue()) {
|
88
|
|
- drawBehind = defaultOptions.drawBehind;
|
89
|
|
- }
|
90
|
|
- if (!animate.hasValue()) {
|
91
|
|
- animate = defaultOptions.animate;
|
92
|
|
- }
|
93
|
|
- if (!tabColor.hasValue()) {
|
94
|
|
- tabColor = defaultOptions.tabColor;
|
95
|
|
- }
|
96
|
|
- if (!selectedTabColor.hasValue()) {
|
97
|
|
- selectedTabColor = defaultOptions.selectedTabColor;
|
98
|
|
- }
|
99
|
|
- if (!backgroundColor.hasValue()) {
|
100
|
|
- backgroundColor = defaultOptions.backgroundColor;
|
101
|
|
- }
|
|
64
|
+ if (!currentTabId.hasValue()) currentTabId = defaultOptions.currentTabId;
|
|
65
|
+ if (!currentTabIndex.hasValue()) currentTabIndex = defaultOptions.currentTabIndex;
|
|
66
|
+ if (!visible.hasValue()) visible = defaultOptions.visible;
|
|
67
|
+ if (!drawBehind.hasValue()) drawBehind = defaultOptions.drawBehind;
|
|
68
|
+ if (!animate.hasValue()) animate = defaultOptions.animate;
|
|
69
|
+ if (!tabColor.hasValue()) tabColor = defaultOptions.tabColor;
|
|
70
|
+ if (!selectedTabColor.hasValue()) selectedTabColor = defaultOptions.selectedTabColor;
|
|
71
|
+ if (!backgroundColor.hasValue()) backgroundColor = defaultOptions.backgroundColor;
|
|
72
|
+ if (!titleDisplayMode.hasValue()) titleDisplayMode = defaultOptions.titleDisplayMode;
|
102
|
73
|
}
|
103
|
74
|
}
|