RelativeLayout is your best friend if you want to make a flexible UI. You can position its child views relative to the layout itself or relative to other views.
This post contains all the code that’s been written in this YouTube video.
Main.axml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/second" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:background="#2196F3" android:textSize="70sp" android:text="2nd" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@id/second" android:layout_toRightOf="@id/second" android:background="#F44336" android:textSize="70sp" android:text="1st" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/second" android:layout_toLeftOf="@id/second" android:background="#4CAF50" android:textSize="70sp" android:text="3rd" /> </RelativeLayout>