Skip to content

Commit

Permalink
Make default formatting more similar to Android Studio default
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteHamster committed Jun 5, 2021
1 parent 393ac54 commit f0711ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected void printElement(Writer out, Element element, int level, NamespaceSta
int start = this.skipLeadingWhite(content, 0);
int size = content.size();
if (start >= size) {
out.write("/>");
out.write(" />");
} else {
out.write(">");
newline(out);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/bytehamster/androidxmlformatter/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void main(String[] args) throws Exception {
.desc("Indention.")
.hasArg().build());
options.addOption(Option.builder().longOpt("attribute-indention")
.desc("Indention of attributes. Omit to keep attributes in one line.")
.desc("Indention of attributes.")
.hasArg().build());
options.addOption(Option.builder().longOpt("attribute-order")
.desc("When ordering attributes by name, use this order. Separated by comma.")
Expand Down Expand Up @@ -61,7 +61,7 @@ public static void main(String[] args) throws Exception {
Document doc = new SAXBuilder().build(new FileInputStream(filename));
XMLOutputter outputter = new AndroidXmlOutputter(
Integer.parseInt(cmd.getOptionValue("indention", "4")),
Integer.parseInt(cmd.getOptionValue("attribute-indention", "8")),
Integer.parseInt(cmd.getOptionValue("attribute-indention", "4")),
cmd.getOptionValue("namespace-order", "android").split(","),
cmd.getOptionValue("attribute-order", "id,layout_width,layout_height").split(","),
cmd.hasOption("attribute-sort"),
Expand Down

0 comments on commit f0711ca

Please sign in to comment.