|
@@ -24,7 +24,6 @@ public class Options {
|
24
|
24
|
Options result = new Options();
|
25
|
25
|
if (json == null) return result.withDefaultOptions(defaultOptions);
|
26
|
26
|
|
27
|
|
- result.orientationOptions = OrientationOptions.parse(json);
|
28
|
27
|
result.topBar = TopBarOptions.parse(typefaceManager, json.optJSONObject("topBar"));
|
29
|
28
|
result.topTabsOptions = TopTabsOptions.parse(json.optJSONObject("topTabs"));
|
30
|
29
|
result.topTabOptions = TopTabOptions.parse(typefaceManager, json.optJSONObject("topTab"));
|
|
@@ -37,11 +36,11 @@ public class Options {
|
37
|
36
|
result.screenBackgroundColor = ColorParser.parse(json, "screenBackgroundColor");
|
38
|
37
|
result.modal = ModalOptions.parse(json);
|
39
|
38
|
result.statusBar = StatusBarOptions.parse(json.optJSONObject("statusBar"));
|
|
39
|
+ result.layout = LayoutOptions.parse(json.optJSONObject("layout"));
|
40
|
40
|
|
41
|
41
|
return result.withDefaultOptions(defaultOptions);
|
42
|
42
|
}
|
43
|
43
|
|
44
|
|
- @NonNull public OrientationOptions orientationOptions = new OrientationOptions();
|
45
|
44
|
@NonNull public TopBarOptions topBar = new TopBarOptions();
|
46
|
45
|
@NonNull public TopTabsOptions topTabsOptions = new TopTabsOptions();
|
47
|
46
|
@NonNull public TopTabOptions topTabOptions = new TopTabOptions();
|
|
@@ -54,6 +53,7 @@ public class Options {
|
54
|
53
|
@NonNull public Color screenBackgroundColor = new NullColor();
|
55
|
54
|
@NonNull public ModalOptions modal = new ModalOptions();
|
56
|
55
|
@NonNull public StatusBarOptions statusBar = new StatusBarOptions();
|
|
56
|
+ @NonNull public LayoutOptions layout = new LayoutOptions();
|
57
|
57
|
|
58
|
58
|
void setTopTabIndex(int i) {
|
59
|
59
|
topTabOptions.tabIndex = i;
|
|
@@ -62,7 +62,6 @@ public class Options {
|
62
|
62
|
@CheckResult
|
63
|
63
|
public Options copy() {
|
64
|
64
|
Options result = new Options();
|
65
|
|
- result.orientationOptions.mergeWith(orientationOptions);
|
66
|
65
|
result.topBar.mergeWith(topBar);
|
67
|
66
|
result.topTabsOptions.mergeWith(topTabsOptions);
|
68
|
67
|
result.topTabOptions.mergeWith(topTabOptions);
|
|
@@ -75,13 +74,13 @@ public class Options {
|
75
|
74
|
result.screenBackgroundColor = screenBackgroundColor;
|
76
|
75
|
result.modal.mergeWith(modal);
|
77
|
76
|
result.statusBar.mergeWith(statusBar);
|
|
77
|
+ result.layout.mergeWith(layout);
|
78
|
78
|
return result;
|
79
|
79
|
}
|
80
|
80
|
|
81
|
81
|
@CheckResult
|
82
|
82
|
public Options mergeWith(final Options other) {
|
83
|
83
|
Options result = copy();
|
84
|
|
- result.orientationOptions.mergeWith(other.orientationOptions);
|
85
|
84
|
result.topBar.mergeWith(other.topBar);
|
86
|
85
|
result.topTabsOptions.mergeWith(other.topTabsOptions);
|
87
|
86
|
result.topTabOptions.mergeWith(other.topTabOptions);
|
|
@@ -93,11 +92,11 @@ public class Options {
|
93
|
92
|
if (other.screenBackgroundColor.hasValue()) result.screenBackgroundColor = other.screenBackgroundColor;
|
94
|
93
|
result.modal.mergeWith(other.modal);
|
95
|
94
|
result.statusBar.mergeWith(other.statusBar);
|
|
95
|
+ result.layout.mergeWith(other.layout);
|
96
|
96
|
return result;
|
97
|
97
|
}
|
98
|
98
|
|
99
|
99
|
Options withDefaultOptions(final Options defaultOptions) {
|
100
|
|
- orientationOptions.mergeWithDefault(defaultOptions.orientationOptions);
|
101
|
100
|
topBar.mergeWithDefault(defaultOptions.topBar);
|
102
|
101
|
topTabOptions.mergeWithDefault(defaultOptions.topTabOptions);
|
103
|
102
|
topTabsOptions.mergeWithDefault(defaultOptions.topTabsOptions);
|
|
@@ -109,6 +108,7 @@ public class Options {
|
109
|
108
|
if (!screenBackgroundColor.hasValue()) screenBackgroundColor = defaultOptions.screenBackgroundColor;
|
110
|
109
|
modal.mergeWithDefault(defaultOptions.modal);
|
111
|
110
|
statusBar.mergeWithDefault(defaultOptions.statusBar);
|
|
111
|
+ layout.mergeWithDefault(defaultOptions.layout);
|
112
|
112
|
return this;
|
113
|
113
|
}
|
114
|
114
|
|