Recently I have updated to Android Studio 3.5. I have three views: an EditText, a TextView and a Button inside a vertical LinearLayout(ViewGroup) named sample.xml file.
When I format the stuff by pressing ctrl+alt+L, all the views get rearranged automatically. In my case the Button view which is in the bottom has reached to top after formatting, also EditText and TextView which is in top first and second are rearranged in second and third position respectively in vertical LinearLayout.
Android Studio : 3.5
Android Gradle Plugin: 3.5.0
OS: Windows 8.1(amd64) v6.3
Please try below settings that worked for me
Settings -> Editor -> Code Style -> XML-> Set From -> Predefined Style > Android.