So I'm trying to configure in Settings--> Code Style --> XML
how I would like the order of the attributes to be sorted when reformatting the code using ctrl+shift+L on Windows.
In my case, first all xmlns
and other namespace attributes and then all the specific views attributes.
In order to do so, I tried playing with the rules preconfigured in the code style settings, and also by creating new rules.
By default, first xmlns
tags are shown, then view attributes, and then tools:...
, as shown in the image here:
When going to Settings--> Code Style --> XML
, I tried playing with the preconfigured rules and even tried creating a new rule, but didn't manage to get the tools:...
attributes to be displayed after the xmlns
attributes.
This is an image of the code style settings screen, also with the rule, I tried to create.
Just to make sure, this is what I'm trying to achieve:
I also trying going over and over the documentaion but couldn't quite figure out how to properly create the rule, since it's not working.
XML code style documentaion
Has anyone tried changing these settings, and/or can help me with the setting?
Thank you
Found the answer:
1. Add a new rule
2. In my case:Name = tools:.*
Namespace = .*
3. Done!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With