Skip to content

Commit f0711ca

Browse files
committed
Make default formatting more similar to Android Studio default
1 parent 393ac54 commit f0711ca

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/com/bytehamster/androidxmlformatter/AndroidXmlOutputter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ protected void printElement(Writer out, Element element, int level, NamespaceSta
304304
int start = this.skipLeadingWhite(content, 0);
305305
int size = content.size();
306306
if (start >= size) {
307-
out.write("/>");
307+
out.write(" />");
308308
} else {
309309
out.write(">");
310310
newline(out);

src/main/java/com/bytehamster/androidxmlformatter/Main.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static void main(String[] args) throws Exception {
2323
.desc("Indention.")
2424
.hasArg().build());
2525
options.addOption(Option.builder().longOpt("attribute-indention")
26-
.desc("Indention of attributes. Omit to keep attributes in one line.")
26+
.desc("Indention of attributes.")
2727
.hasArg().build());
2828
options.addOption(Option.builder().longOpt("attribute-order")
2929
.desc("When ordering attributes by name, use this order. Separated by comma.")
@@ -61,7 +61,7 @@ public static void main(String[] args) throws Exception {
6161
Document doc = new SAXBuilder().build(new FileInputStream(filename));
6262
XMLOutputter outputter = new AndroidXmlOutputter(
6363
Integer.parseInt(cmd.getOptionValue("indention", "4")),
64-
Integer.parseInt(cmd.getOptionValue("attribute-indention", "8")),
64+
Integer.parseInt(cmd.getOptionValue("attribute-indention", "4")),
6565
cmd.getOptionValue("namespace-order", "android").split(","),
6666
cmd.getOptionValue("attribute-order", "id,layout_width,layout_height").split(","),
6767
cmd.hasOption("attribute-sort"),

0 commit comments

Comments
 (0)