Giter Site home page Giter Site logo

android-xml-formatter's Introduction

android-xml-formatter

Formats xml files according to Android Studio's default formatting rules. By default, also re-orders the attributes to specify the android:id, android:layout_width and android:layout_height first. This can be turned off with a command line option.

To view available command line options, execute java -jar android-xml-formatter.jar --help.

Can be used as a style check on a CI server by executing and then printing the diff.

android-xml-formatter's People

Contributors

bytehamster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

android-xml-formatter's Issues

New lines configurable

I want to have 0 new lines between nodes. Currently, it's always set to 1:

Actual formatting:

<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:layout_width="match_parent"
    tools:layout_height="match_parent"
    tools:background="#000000"
    tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">

  <com.vanniktech.feature.gps.VanniktechMapView
      android:id="@+id/mapView"
      android:layout_width="match_parent"
      android:layout_height="match_parent" />

Wanted formatting:

<?xml version="1.0" encoding="utf-8"?>
<merge
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:layout_width="match_parent"
    tools:layout_height="match_parent"
    tools:background="#000000"
    tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
  <com.vanniktech.feature.gps.VanniktechMapView
      android:id="@+id/mapView"
      android:layout_width="match_parent"
      android:layout_height="match_parent" />

Would it be possible to set the number of lines between nodes? 1 for the current behavior (and can be the default) and 0 for the behavior, I want?

Option to place close tag `/>` on new line

<com.vanniktech.feature.gps.VanniktechMapView
      android:id="@+id/mapView"
      android:layout_width="match_parent"
-     android:layout_height="match_parent" />
+     android:layout_height="match_parent"
+     />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.