f you are not read yet the part-05 blog then first of all you read and implement part-01 visit CLICK HERE. Because this blog linked with part-05

In this blog, we can create a Signup Fragment to create and design a username, email, password, and confirm a password that is shown in front of users.

First, we have to do Insert your New Fragment in your project with the help of this video CLICK HERE and implement a code which is given below.

In this fragment, you get a default layout named constraint layout so we can start the design with this layout. Under this layout, we can create a Name, Email ID, Password, and Confirm Password layout for the user registration process.

First we create a Name Edit Text Layout given below.

<EditText
android:id="@+id/user_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:autofillHints=""
android:background="@drawable/edit_text_bg"
android:hint="@string/name"
android:inputType="textPersonName"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textAllCaps="true"
android:textColor="@color/purple_700"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias=".5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias=".1"
app:layout_constraintWidth_percent=".8" />

Now, we can create Email ID Edit Text Layout.

<EditText
android:id="@+id/email_id"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:autofillHints=""
android:background="@drawable/edit_text_bg"
android:hint="@string/email_id"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textColor="@color/purple_700"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias=".5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/user_name"
app:layout_constraintVertical_bias="0"
app:layout_constraintWidth_percent=".8"
android:inputType="textEmailAddress" />

Now, we create a Password Edit Text Layout.

<EditText
android:id="@+id/password"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:autofillHints=""
android:background="@drawable/edit_text_bg"
android:hint="@string/password"
android:inputType="textPassword"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textColor="@color/purple_700"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias=".5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/email_id"
app:layout_constraintVertical_bias="0"
app:layout_constraintWidth_percent=".8" />

And last, we create a confirm password Edit Text Layout.

<EditText
android:id="@+id/confPassword"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:autofillHints=""
android:background="@drawable/edit_text_bg"
android:hint="@string/confirm_password"
android:inputType="textPassword"
android:paddingStart="20dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textColor="@color/purple_700"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias=".5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/password"
app:layout_constraintVertical_bias="0"
app:layout_constraintWidth_percent=".8" />

Finally, we create a Button to submit above all information to save our cloud database.

<Button
android:id="@+id/signup"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/button_bg"
android:fontFamily="@font/aldrich"
android:text="@string/signup"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/confPassword"
app:layout_constraintWidth_percent=".8" />

We inserted all code in our android project for the user registration process. So if you want to read the next blog then CLICK HERE.


0 Comments

Leave a Reply

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