4

I am having an annoying issue with the latest Android Studio, version 3.2.1. Before updating it, when I was assigning constraints, the code generated would be properly organized, with each property below the other, separating the margins and the constraints, like this one, for instance:

<ProgressBar
    android:id="@+id/pb_loading_users"
    android:layout_width="42dp"
    android:layout_height="42dp"
    android:layout_marginTop="38dp"
    android:visibility="gone"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"/>

But now, it's all messy and it's not automatically placing one property per line, but two per line and I dislike it:

<ImageView
        android:layout_width="64dp"
        android:layout_height="64dp" app:layout_constraintStart_toStartOf="parent"
        android:layout_marginStart="8dp"  app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent" />

It's a waste of time to manually organize. Is it a bug or something I can fix myself?

1 Answers1

0

Not the real answer but a method how to bring the code to a proper format with just three key strokes.

Press Ctrl + Alt + L, it automatically reformat the code will save you your manual work.

Psytho
  • 3,313
  • 2
  • 19
  • 27
  • 2
    Not exactly. This will not make the properties of the tag be below each other as it should be done automatically when selecting a tag from the autocomplete dropdown or assigning constraints. I am sure it is a bug and shall be fixed soon. –  Oct 20 '18 at 04:24