Can we change the default Build behavior of Android Studio from Constraint to Relative Layout?
Problem: Sometimes it takes more time to Clean/Rebuild my project. And I never use Constraint Layout, so I want to set the build behavior of Android Studio from Constraint Layout
to Relative Layout
.
I want every-time I open AS, it should open Relative. Is it possible to achieve?
Quite Easy - just in 3 steps
C:\Program Files\Android\Android Studio\plugins\android\lib\templates\activities\common\root\res\layout
simple.xml.ftl
simple.xml.ftl
to below code and save it <RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="${packageName}.${activityClass}">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:text="Sample"
android:textSize="16sp" />
</RelativeLayout>
Tried and tested on Windows 10
build:gradle:3.0.1
simple.xml.ftl
file with Admin rightslayout > New > Edit File Templates...
your layoutResourceFile
and layoutResourceFile_vertical
by removing the ${ROOT_TAG}
- as I have already tried but that doesn't work.