|
@@ -32,6 +32,7 @@ public class TitleOptions {
|
32
|
32
|
options.fontFamily = typefaceManager.getTypeFace(json.optString("fontFamily", ""));
|
33
|
33
|
options.alignment = Alignment.fromString(TextParser.parse(json, "alignment").get(""));
|
34
|
34
|
options.height = NumberParser.parse(json, "height");
|
|
35
|
+ options.topMargin = NumberParser.parse(json, "topMargin");
|
35
|
36
|
|
36
|
37
|
return options;
|
37
|
38
|
}
|
|
@@ -43,6 +44,7 @@ public class TitleOptions {
|
43
|
44
|
@Nullable public Typeface fontFamily;
|
44
|
45
|
public Component component = new Component();
|
45
|
46
|
public Number height = new NullNumber();
|
|
47
|
+ public Number topMargin = new NullNumber();
|
46
|
48
|
|
47
|
49
|
void mergeWith(final TitleOptions other) {
|
48
|
50
|
if (other.text.hasValue()) text = other.text;
|
|
@@ -52,6 +54,7 @@ public class TitleOptions {
|
52
|
54
|
if (other.alignment != Alignment.Default) alignment = other.alignment;
|
53
|
55
|
if (other.component.hasValue()) component = other.component;
|
54
|
56
|
if (other.height.hasValue()) height = other.height;
|
|
57
|
+ if (other.topMargin.hasValue()) topMargin = other.topMargin;
|
55
|
58
|
}
|
56
|
59
|
|
57
|
60
|
void mergeWithDefault(TitleOptions defaultOptions) {
|
|
@@ -62,5 +65,6 @@ public class TitleOptions {
|
62
|
65
|
if (alignment == Alignment.Default) alignment = defaultOptions.alignment;
|
63
|
66
|
component.mergeWithDefault(defaultOptions.component);
|
64
|
67
|
if (!height.hasValue()) height = defaultOptions.height;
|
|
68
|
+ if (!topMargin.hasValue()) topMargin = defaultOptions.topMargin;
|
65
|
69
|
}
|
66
|
70
|
}
|