LayoutFormatter

Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion Gogland DataGrip Rider MPS Android Studio
24.08.2017
7 540
Retrofit your Android layout XML files.

It will adjust your attributes order in accordance with the rules, and it will adjust some attributes to the front, and take some attributes at the end of the rows. It will make your code format more nice.

It is open source. https://github.com/drakeet/LayoutFormatter
Related articles: 当我们谈 XML 布局文件代码的优雅性

Download plugin

Recent change notes

v1.2.0
- Supported all of attrs of ConstraintLayout
- Supplied some attrs of aligns
v1.1.5
- Removed a rule: android:singleLine="true"(It's deprecated) -> android:maxLines="1"(It's DEPRECATED, too!);


v1.1.2
- Supported Windows system;
- Fixed the "/><" bug.

v1.1.1
- Adjusted the location of the Action to RefactoringMenu;
- Supported UNDO;
- Support one key to format all XML files on the entire project or folder;
- Add default keyboard-shortcut: ctrl alt F (command alt F).

v1.0.4
- Fixed the bad style that ">" or "/>" may be moved to a newline;
- Added "fill_parent" to "match_parent";
- Added "dip" to "dp".

General usage instructions

Retrofit your Android layout XML files. It will adjust your attributes order in accordance with the rules, and it will adjust some attributes to the front, and take some attributes at the end of the rows. It will make your code format more nice. It is open source: https://github.com/drakeet/LayoutFormatter