7

Today I have updated the latest version of the Stable Android Studio 3.5 and in this version, layout editor has some strange behavior.

When I try to reformat the code by using Android studio shortcut Ctrl+Alt+L but it reformats the entire components that are present it not the code, I have also tried using Code -> Reformat Code. but facing the same issue.

XML layout before rearrange code,

<LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/quick_start_title_text_top_margin"
        android:gravity="center"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/quick_start"
            android:textColor="@color/colorBlack"
            android:textSize="@dimen/quick_start_title_text"
            app:fontPath="@string/font_semi_bold" />

        <android.support.v7.widget.AppCompatImageView
            android:layout_width="60dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:src="@drawable/bg_quick_start_line" />
</LinearLayout>

XML After rearrange code,

<LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/quick_start_title_text_top_margin"
        android:gravity="center"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <android.support.v7.widget.AppCompatImageView
            android:layout_width="60dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:src="@drawable/bg_quick_start_line" />

        <android.support.v7.widget.AppCompatTextView
            android:id="@+id/tv_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/quick_start"
            android:textColor="@color/colorBlack"
            android:textSize="@dimen/quick_start_title_text"
             app:fontPath="@string/font_semi_bold" />

    </LinearLayout>

It rearranges all the components rather than rearrange the Code (like attributes) in components.

So please help me to resolve the issue or can someone help to give some setting in Android Studio to solve this.

Muneeb Ali
  • 472
  • 6
  • 14
Chandan Sharma
  • 2,803
  • 1
  • 17
  • 25

0 Answers0