Attractive Signup screen in Android

In this article, we are going to learn how to create an attractive Signup screen in Android.

In the below image you can see that what are we going to build.

Hope so you are interested to know how to make the above attractive Signup screen, so now without wasting much time let’s start.

You can also refer our video tutorial for same.

So let’s start with this tutorial :

Attractive Signup screen in Android

1.  Create a new project in Android Studio by navigating to File ⇒ New ⇒ New Project and provide a name to your project. By default activity name is MainActivity.java.

2.  Now open res => values => styles.xml file and paste the below code to change the color of the status bar.

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">#E53935</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

3. Now open MainActivity.java file and add the below line to hide the action bar in app.

package com.thecodingshef.regvideo;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        getSupportActionBar().hide();
    }
}

4. Now to apply custom font, create a new resource directory by navigating res => New => Android Resource Directory and give the directory name as “font” and select “font” from resource type.

5. Now download this folder and copy all drawable resources from the drawable folder and paste all in res => drawable and copy all fonts from the font folder and paste in the font res => font.

6. Now Finally go to your activity_main.xml file to make the main user interface for the signup screen and paste the below lines of codes.

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:background="@drawable/back"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="180dp"
        android:fontFamily="@font/roboto_regular"
        android:text="LOGO"
        android:textSize="40sp"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/usernameText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="40dp"
        android:layout_marginRight="45dp"
        android:drawableRight="@drawable/username"
        android:drawableTint="#7C000000"
        android:fontFamily="@font/roboto_regular"
        android:text="User name"
        android:textColor="#7C000000"
        android:textSize="12sp"
        app:layout_constraintTop_toBottomOf="@+id/text" />

    <androidx.cardview.widget.CardView
        android:id="@+id/edit_username"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="40dp"
        app:cardCornerRadius="5dp"
        app:cardElevation="5dp"
        app:layout_constraintTop_toBottomOf="@+id/usernameText">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:fontFamily="@font/roboto_regular"
            android:paddingLeft="10dp"
            android:textSize="14sp"
            android:background="#fff"
            android:cursorVisible="false" />
    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/emailText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="15dp"
        android:layout_marginRight="45dp"
        android:drawableRight="@drawable/email"
        android:drawableTint="#7C000000"
        android:fontFamily="@font/roboto_regular"
        android:text="Email"
        android:textColor="#7C000000"
        android:textSize="12sp"
        app:layout_constraintTop_toBottomOf="@+id/edit_username" />

    <androidx.cardview.widget.CardView
        android:id="@+id/edit_email"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="40dp"
        app:cardCornerRadius="5dp"
        app:cardElevation="5dp"
        app:layout_constraintTop_toBottomOf="@+id/emailText">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:fontFamily="@font/roboto_regular"
            android:paddingLeft="10dp"
            android:textSize="14sp"
            android:background="#fff"
            android:cursorVisible="false" />
    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/passwordText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="15dp"
        android:layout_marginRight="45dp"
        android:drawableRight="@drawable/password"
        android:drawableTint="#7C000000"
        android:fontFamily="@font/roboto_regular"
        android:text="Password"
        android:textColor="#7C000000"
        android:textSize="12sp"
        app:layout_constraintTop_toBottomOf="@+id/edit_email" />

    <androidx.cardview.widget.CardView
        android:id="@+id/edit_password"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="40dp"
        app:cardCornerRadius="5dp"
        app:cardElevation="5dp"
        app:layout_constraintTop_toBottomOf="@+id/passwordText">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:fontFamily="@font/roboto_regular"
            android:paddingLeft="10dp"
            android:textSize="14sp"
            android:background="#fff"
            android:cursorVisible="false" />
    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/confirmText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="15dp"
        android:layout_marginRight="45dp"
        android:drawableRight="@drawable/password"
        android:drawableTint="#7C000000"
        android:fontFamily="@font/roboto_regular"
        android:text="Confirm password"
        android:textColor="#7C000000"
        android:textSize="12sp"
        app:layout_constraintTop_toBottomOf="@+id/edit_password" />

    <androidx.cardview.widget.CardView
        android:id="@+id/edit_confirm"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginLeft="40dp"
        android:layout_marginTop="10dp"
        android:layout_marginRight="40dp"
        app:cardCornerRadius="5dp"
        app:cardElevation="5dp"
        app:layout_constraintTop_toBottomOf="@+id/confirmText">

        <EditText
            android:layout_width="match_parent"
            android:layout_height="40dp"
            android:fontFamily="@font/roboto_regular"
            android:paddingLeft="10dp"
            android:textSize="14sp"
            android:background="#fff"
            android:cursorVisible="false" />
    </androidx.cardview.widget.CardView>
    <androidx.cardview.widget.CardView
        android:id="@+id/btn"
        android:layout_width="200dp"
        android:layout_height="55dp"
        android:layout_marginRight="40dp"
        android:layout_marginBottom="70dp"
        app:cardBackgroundColor="#F4511E"
        app:cardCornerRadius="25dp"
        app:cardElevation="10dp"
        android:layout_marginTop="50dp"
        app:layout_constraintTop_toBottomOf="@+id/edit_confirm"
        app:layout_constraintRight_toRightOf="parent">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:fontFamily="@font/roboto_regular"
            android:text="Sign up"
            android:textAlignment="center"
            android:textColor="#fff"
            android:textSize="20sp" />
    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/google"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_marginTop="10dp"
        app:cardCornerRadius="25dp"
        app:cardElevation="10dp"
        app:layout_constraintHorizontal_bias="0.32"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/google"
            android:layout_gravity="center"
            android:tint="#E53935"
            />
    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/facebook"
        android:layout_width="50dp"
        android:layout_height="50dp"
        app:cardCornerRadius="25dp"
        app:cardElevation="10dp"
        app:layout_constraintHorizontal_bias="0.6"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/google">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/facebook"
            android:layout_gravity="center"
            android:tint="#3949AB"
            />
    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/twitter"
        android:layout_width="50dp"
        android:layout_height="50dp"
        app:cardCornerRadius="25dp"
        app:cardElevation="10dp"
        app:layout_constraintHorizontal_bias="0.87"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/facebook">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/twitter"
            android:layout_gravity="center"
            android:tint="#00ACC1"
            />
    </androidx.cardview.widget.CardView>

</androidx.constraintlayout.widget.ConstraintLayout>

7. Finally, run the app and you will get the output as shown in demo image.

If you found this post useful, don’t forget to share this with your friends, and if you have any query feel free to comment it in the comment section.

Thank you 🙂 Keep Learning !

Leave a Comment

Your email address will not be published. Required fields are marked *