Mohad Hadi
Mohad Hadi

Reputation: 1986

Android Studio 3.2.1, XML bad indent format

After updating to Android Studio 3.2.1 the XML files format is very annoying and bad, how can we fix it? Can we change it from somewhere in settings to previews type?

new format

Upvotes: 17

Views: 7078

Answers (3)

efr
efr

Reputation: 301

Open File > Settings > Editor > Code Style > XML

Now in layout file make sure you have selected wrap attributes as Wrap always.
Screenshot

Upvotes: 10

Badr
Badr

Reputation: 2091

On Android Studio 3, Go to :

Preferences > Editor > Code style > XML then on Scheme switch to Default instead of Project.

You can then use those shortcuts to indent your code:

Windows:

Ctrl + Alt + L

macOS:

Option + Command + L

Upvotes: 31

Chris Stillwell
Chris Stillwell

Reputation: 10547

You can edit your code styles under File > Settings > Editor > Code Style > XML

Code Style Settings

If you want to preview a specific file, just paste that file's contents into the preview window.

Upvotes: 21

Related Questions