|
@@ -23,19 +23,25 @@ public class StyleParamsParser {
|
23
|
23
|
result.statusBarColor = getColor("statusBarColor", getDefaultStatusBarColor());
|
24
|
24
|
|
25
|
25
|
result.topBarColor = getColor("topBarColor", getDefaultTopBarColor());
|
26
|
|
- result.titleBarHidden = getBoolean("titleBarHidden", isDefaultTopBarHidden());
|
|
26
|
+ result.titleBarHidden = getBoolean("titleBarHidden", getDefaultTopBarHidden());
|
27
|
27
|
result.titleBarTitleColor = getColor("titleBarTitleColor", getDefaultTitleBarColor());
|
28
|
28
|
result.titleBarButtonColor = getColor("titleBarButtonColor", getTitleBarButtonColor());
|
29
|
|
- result.backButtonHidden = getBoolean("backButtonHidden", isDefaultBackButtonHidden());
|
30
|
|
- result.topTabsHidden = getBoolean("topTabsHidden", isDefaultTopTabsHidden());
|
|
29
|
+ result.backButtonHidden = getBoolean("backButtonHidden", getDefaultBackButtonHidden());
|
|
30
|
+ result.topTabsHidden = getBoolean("topTabsHidden", getDefaultTopTabsHidden());
|
|
31
|
+
|
|
32
|
+ result.topTabTextColor = getColor("topTabTextColor", getDefaultTopTabTextColor());
|
|
33
|
+ result.selectedTopTabTextColor = getColor("selectedTopTabTextColor", getDefaultSelectedTopTabTextColor());
|
|
34
|
+ result.selectedTopTabColor = getColor("selectedTopTabColor", getDefaultSelectedTopTabColor());
|
|
35
|
+ result.selectedTopTabIndicatorHeight = getInt("selectedTopTabIndicatorHeight", getDefaultSelectedTopTabIndicatorHeight());
|
|
36
|
+ result.selectedTopTabIndicatorColor = getColor("selectedTopTabIndicatorColor", getDefaultSelectedTopTabIndicatorColor());
|
31
|
37
|
|
32
|
38
|
// TODO: Uncomment once we support drawBelowTopBar again
|
33
|
39
|
//result.drawScreenBelowTopBar = params.getBoolean("drawBelowTopBar", isDefaultScreenBelowTopBar());
|
34
|
40
|
result.drawScreenBelowTopBar = true;
|
35
|
41
|
|
36
|
|
- result.bottomTabsHidden = getBoolean("bottomTabsHidden", isDefaultBottomTabsHidden());
|
|
42
|
+ result.bottomTabsHidden = getBoolean("bottomTabsHidden", getDefaultBottomTabsHidden());
|
37
|
43
|
result.bottomTabsHiddenOnScroll =
|
38
|
|
- getBoolean("bottomTabsHiddenOnScroll", isDefaultBottomTabsHiddenOnScroll());
|
|
44
|
+ getBoolean("bottomTabsHiddenOnScroll", getDefaultBottomTabsHiddenOnScroll());
|
39
|
45
|
result.bottomTabsColor = getColor("bottomTabsColor", getDefaultBottomTabsColor());
|
40
|
46
|
result.bottomTabsButtonColor = getColor("bottomTabsButtonColor", getDefaultBottomTabsButtonColor());
|
41
|
47
|
result.selectedBottomTabsButtonColor =
|
|
@@ -46,6 +52,22 @@ public class StyleParamsParser {
|
46
|
52
|
return result;
|
47
|
53
|
}
|
48
|
54
|
|
|
55
|
+ private StyleParams.Color getDefaultSelectedTopTabIndicatorColor() {
|
|
56
|
+ return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.selectedTopTabIndicatorColor;
|
|
57
|
+ }
|
|
58
|
+
|
|
59
|
+ private int getDefaultSelectedTopTabIndicatorHeight() {
|
|
60
|
+ return AppStyle.appStyle == null ? -1 : AppStyle.appStyle.selectedTopTabIndicatorHeight;
|
|
61
|
+ }
|
|
62
|
+
|
|
63
|
+ private StyleParams.Color getDefaultSelectedTopTabColor() {
|
|
64
|
+ return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.selectedTopTabColor;
|
|
65
|
+ }
|
|
66
|
+
|
|
67
|
+ private StyleParams.Color getDefaultSelectedTopTabTextColor() {
|
|
68
|
+ return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.selectedTopTabTextColor;
|
|
69
|
+ }
|
|
70
|
+
|
49
|
71
|
@Nullable
|
50
|
72
|
private StyleParams.Color getDefaultNavigationColor() {
|
51
|
73
|
return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.navigationBarColor;
|
|
@@ -66,11 +88,11 @@ public class StyleParamsParser {
|
66
|
88
|
return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.bottomTabsColor;
|
67
|
89
|
}
|
68
|
90
|
|
69
|
|
- private boolean isDefaultBottomTabsHiddenOnScroll() {
|
|
91
|
+ private boolean getDefaultBottomTabsHiddenOnScroll() {
|
70
|
92
|
return AppStyle.appStyle != null && AppStyle.appStyle.bottomTabsHiddenOnScroll;
|
71
|
93
|
}
|
72
|
94
|
|
73
|
|
- private boolean isDefaultBottomTabsHidden() {
|
|
95
|
+ private boolean getDefaultBottomTabsHidden() {
|
74
|
96
|
return AppStyle.appStyle != null && AppStyle.appStyle.bottomTabsHidden;
|
75
|
97
|
}
|
76
|
98
|
|
|
@@ -78,11 +100,15 @@ public class StyleParamsParser {
|
78
|
100
|
return AppStyle.appStyle == null || AppStyle.appStyle.drawScreenBelowTopBar;
|
79
|
101
|
}
|
80
|
102
|
|
81
|
|
- private boolean isDefaultTopTabsHidden() {
|
|
103
|
+ private boolean getDefaultTopTabsHidden() {
|
82
|
104
|
return AppStyle.appStyle != null && AppStyle.appStyle.topTabsHidden;
|
83
|
105
|
}
|
84
|
106
|
|
85
|
|
- private boolean isDefaultBackButtonHidden() {
|
|
107
|
+ private StyleParams.Color getDefaultTopTabTextColor() {
|
|
108
|
+ return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.topTabTextColor;
|
|
109
|
+ }
|
|
110
|
+
|
|
111
|
+ private boolean getDefaultBackButtonHidden() {
|
86
|
112
|
return AppStyle.appStyle != null && AppStyle.appStyle.backButtonHidden;
|
87
|
113
|
}
|
88
|
114
|
|
|
@@ -96,7 +122,7 @@ public class StyleParamsParser {
|
96
|
122
|
return AppStyle.appStyle == null ? new StyleParams.Color() : AppStyle.appStyle.titleBarButtonColor;
|
97
|
123
|
}
|
98
|
124
|
|
99
|
|
- private boolean isDefaultTopBarHidden() {
|
|
125
|
+ private boolean getDefaultTopBarHidden() {
|
100
|
126
|
return AppStyle.appStyle != null && AppStyle.appStyle.titleBarHidden;
|
101
|
127
|
}
|
102
|
128
|
|
|
@@ -123,4 +149,10 @@ public class StyleParamsParser {
|
123
|
149
|
return defaultColor != null && defaultColor.hasColor() ? defaultColor : color;
|
124
|
150
|
}
|
125
|
151
|
}
|
|
152
|
+
|
|
153
|
+ private int getInt(String selectedTopTabIndicatorHeight, int defaultSelectedTopTabIndicatorHeight) {
|
|
154
|
+ return params.containsKey(selectedTopTabIndicatorHeight) ?
|
|
155
|
+ (int) params.getDouble(selectedTopTabIndicatorHeight) :
|
|
156
|
+ defaultSelectedTopTabIndicatorHeight;
|
|
157
|
+ }
|
126
|
158
|
}
|