|
@@ -30,6 +30,7 @@ public class TitleOptions {
|
30
|
30
|
options.color = ColorParser.parse(json, "color");
|
31
|
31
|
options.fontSize = FractionParser.parse(json, "fontSize");
|
32
|
32
|
options.fontFamily = typefaceManager.getTypeFace(json.optString("fontFamily", ""));
|
|
33
|
+ options.alignment = Alignment.fromString(TextParser.parse(json, "alignment").get(""));
|
33
|
34
|
options.component = TextParser.parse(json, "component");
|
34
|
35
|
options.componentAlignment = Alignment.fromString(TextParser.parse(json, "componentAlignment").get(""));
|
35
|
36
|
|
|
@@ -41,6 +42,7 @@ public class TitleOptions {
|
41
|
42
|
public Text text = new NullText();
|
42
|
43
|
public Color color = new NullColor();
|
43
|
44
|
public Fraction fontSize = new NullFraction();
|
|
45
|
+ public Alignment alignment = Alignment.Default;
|
44
|
46
|
@Nullable public Typeface fontFamily;
|
45
|
47
|
public Text component = new NullText();
|
46
|
48
|
public Alignment componentAlignment = Alignment.Default;
|
|
@@ -50,6 +52,7 @@ public class TitleOptions {
|
50
|
52
|
if (other.color.hasValue()) color = other.color;
|
51
|
53
|
if (other.fontSize.hasValue()) fontSize = other.fontSize;
|
52
|
54
|
if (other.fontFamily != null) fontFamily = other.fontFamily;
|
|
55
|
+ if (other.alignment != Alignment.Default) alignment = other.alignment;
|
53
|
56
|
if (other.component.hasValue()) component = other.component;
|
54
|
57
|
if (other.componentAlignment != Alignment.Default) componentAlignment = other.componentAlignment;
|
55
|
58
|
validate(this);
|
|
@@ -60,6 +63,7 @@ public class TitleOptions {
|
60
|
63
|
if (!color.hasValue()) color = defaultOptions.color;
|
61
|
64
|
if (!fontSize.hasValue()) fontSize = defaultOptions.fontSize;
|
62
|
65
|
if (fontFamily == null) fontFamily = defaultOptions.fontFamily;
|
|
66
|
+ if (alignment == Alignment.Default) alignment = defaultOptions.alignment;
|
63
|
67
|
if (!component.hasValue()) component = defaultOptions.component;
|
64
|
68
|
if (componentAlignment == Alignment.Default) componentAlignment = defaultOptions.componentAlignment;
|
65
|
69
|
validate(this);
|