I am working on a project and I am trying to make the layout of the login screen. Layout Image
and here's my xml code
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.ngo.ravi.idi.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="30dp"
android:background="@color/colorPrimaryDark">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="35sp"
android:textColor="#FFF"
android:text="@string/welcome"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:fontFamily="@font/autour_one"
android:text="@string/descrip"
android:textColor="#fff"
android:textSize="15sp"/>
<Button
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="@string/learnMore"
android:layout_gravity="center"
android:layout_marginTop="30dp"
android:textColor="#fff"
android:background="@drawable/buttonstyle2"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="@string/email" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">
<EditText
android:layout_width="300dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress"
android:hint="@string/password" />
</android.support.design.widget.TextInputLayout>
<Button
android:layout_marginTop="20dp"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="@string/login"
android:background="@drawable/buttonstyle"/>
</LinearLayout>
I am facing a problem with its display. I am using emulator to check this app and I tried this in 4", 4.7", 5", 5.2", 6" display and it works fine with 5" and above but when I tried this with 4" and 4.7" I found that the text of this wouldn't scaling down. Is there any way to make this app to automatic scaling as per the device.
Thank in Advance