diff --git a/src/main/java/org/commcare/suite/model/DetailField.java b/src/main/java/org/commcare/suite/model/DetailField.java index 18be0e882..33c09c20e 100644 --- a/src/main/java/org/commcare/suite/model/DetailField.java +++ b/src/main/java/org/commcare/suite/model/DetailField.java @@ -198,6 +198,9 @@ public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOExcep gridHeight = ExtUtil.readInt(in); fontSize = ExtUtil.nullIfEmpty(ExtUtil.readString(in)); showBlanksLastInSort = ExtUtil.readBool(in); + horizontalAlign = ExtUtil.nullIfEmpty(ExtUtil.readString(in)); + verticalAlign = ExtUtil.nullIfEmpty(ExtUtil.readString(in)); + cssID = ExtUtil.nullIfEmpty(ExtUtil.readString(in)); } @Override @@ -224,6 +227,9 @@ public void writeExternal(DataOutputStream out) throws IOException { ExtUtil.writeNumeric(out, gridHeight); ExtUtil.writeString(out, ExtUtil.emptyIfNull(fontSize)); ExtUtil.writeBool(out, showBlanksLastInSort); + ExtUtil.writeString(out, ExtUtil.emptyIfNull(horizontalAlign)); + ExtUtil.writeString(out, ExtUtil.emptyIfNull(verticalAlign)); + ExtUtil.writeString(out, ExtUtil.emptyIfNull(cssID)); } public int getGridX() { diff --git a/src/main/java/org/commcare/suite/model/Style.java b/src/main/java/org/commcare/suite/model/Style.java index dea02e4a2..a53eb67c4 100644 --- a/src/main/java/org/commcare/suite/model/Style.java +++ b/src/main/java/org/commcare/suite/model/Style.java @@ -8,6 +8,8 @@ public class Style { private DisplayFormat displayFormats; private int fontSize; private int widthHint; + private String horizontalAlign; + private String verticalAlign; public Style(){} @@ -30,6 +32,9 @@ public Style(DetailField detail){ setWidthHint(-1); } setDisplayFormatFromString(detail.getTemplateForm()); + + verticalAlign = detail.getVerticalAlign(); + horizontalAlign = detail.getHorizontalAlign(); } enum DisplayFormat { @@ -105,4 +110,12 @@ private void setDisplayFormatFromString(String displayFormat){ public String toString(){ return "Style: [displayFormat=" + displayFormats + ", fontSize=" + fontSize + "]"; } + + public String getHorizontalAlign() { + return horizontalAlign; + } + + public String getVerticalAlign() { + return verticalAlign; + } }