Android Studio XML reformat code ignores xmlns:.* attributes

121 Views Asked by At

Android Studio's reformat code ignores the first 2 Matching rules I've configured, rule for placing xmlns:android attribute as the first attribute and xmlns:.* attributes right below it.

My Matching rules: Matching rules

The code after reformatting: layout.xml

Are my rules right defined? Is this a bug in Android Studio?

I'm using Android Studio 2.0 beta 5.

1

There are 1 best solutions below

0
On BEST ANSWER

So, I've got the answer thanks to my colleague.

  1. You have to set ALL the rules as attributes OR remove attribute flag in ALL of them.
  2. set .* as namespace for xmlns:.* rules

Example: Matching rules