1

Let's say I have the following TextView:

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

In the past when I wanted to add a new attribute I would put the cursor before /> hit enter and the cursor would move to the next align aligned with the start of the previous line. Now for some reason when I hit enter it goes to the next line but to the start of the file, it doesn't indent automatically, which is pretty annoying. I hit enter and the new line appears like this:

<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
android:text="text"/>

What's going on? I did change the version of Android Studio. I was running the stable one but decided to try the beta.

dfasdflskladf
  • 101
  • 1
  • 6
  • Did you check if you have any errors in the layout. Or is it something that is happening all the time no matter what layout you are editting? – Juan Dec 15 '18 at 15:53
  • @Juan It happens even with the fresh project after restart. Okay I think I solved the problem. Settings -> Editor -> Code Style -> XML -> Set from... -> Kotlin. I'm not sure why it doesn't have XML but setting it as Kotlin solved the problem. – dfasdflskladf Dec 15 '18 at 16:00
  • @dfasdflskladf, then answer your own question and accept that – letsintegreat Dec 15 '18 at 16:04

1 Answers1

0

Settings -> Editor -> Code Style -> XML -> Set from... -> Kotlin solved the problem.

dfasdflskladf
  • 101
  • 1
  • 6