Android Studio 3.5 Refactor Issue

Android studio 3.5 refactor issue

You just need to set xml layout for Android applications from the settings.

Follow this steps:

1. Go to Android Studio > Preferences. For Windows, go to File > Settings.

Sample Image

2. Search for xml in search bar.

Sample Image

3. Under code style section, select xml tab.

Sample Image

4. In the top right corner, click on set from... and under predefined style, select Android

Sample Image

5. Click on Apply and try to refactor.

Unexpected XML View formatting Android Studio 3.5

Found the solution:

Preferences -> Editor -> Code Style -> XML

Search for Set from on the top left.

Set from -> Predefined Style -> Android

Don't forget to apply your changes

Hope this helps someone

Android Studio 3.5 - Formatting (ctrl+Alt+L) the code in XML file is rearranging the Views in the LinearLayout

Please try below settings that worked for me

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

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

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

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

Sample Image

Android Studio - Refactor move files still keeps a copy in original place

Posting an answer is because I don't have enough reputation.
after refactoring the file actually moves there but it is bug I also have noticed, A copy of the file seems to be present in the old places even after refactoring but after refreshing It is gone.

How to fix Android studio 3.5 navigation activity template onNavigationItemSelected not working

this problem is caused by the ordering issue of xml file from main content

the default order:

<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />

<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />

change to following order:

<include
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<com.google.android.material.navigation.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />


Related Topics



Leave a reply



Submit