androidxmlformatandroid-studio-3.5

XML code formatting gives wrong arranging child views in LinearLayout Android Studio 3.5


Menu -> Code -> Reformat Code

Previous Android Studio version, my hands are very used to click Ctl+Alt+L to format code whenever I have typed some code block. After I updated to Android Studio 3.5, I formatted the code in XML and it is giving me wrong arrangement of my views and destroying my design.

Here is the design before code reformatting.

enter image description here

After code reformatted (click -> Ctl+Alt+L), my views was shuffled in both design and xml code side. please see second picture.

enter image description here

It seems a bug and I already reported it to Google Issue Tracker.


Solution

  • I just got answer from one of my colleague. That works well.

    Settings -> Editor -> Code Style -> XML-> Set From -> Predefined Style > Android.

    enter image description here