How to Create Modern Sign-up Form in android from Scratch - Passionate Geekz

Breaking

Where you can unleash your inner geek.

Wednesday, 11 September 2019

How to Create Modern Sign-up Form in android from Scratch

In this tutorial we are Creating modern Sign-up Form in android from Scratch

To begin create  android project file > new >new project>start with empty activity

Now you can use content _main.xml or you can create xml file by right click on layout folder>new>XML>layout xml named it as content.xml. and type the following code , in this we are creating the UI login screen.

To make your login screen more responsive here i will use google card view.

Go to your build.gradle (module:app)>add following code
dependencies {implementation 'com.android.support:cardview-v7:28.0.0' }
Now open your content_main.xml and start codding.............
<?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/wal"    app:layout_behavior="@string/appbar_scrolling_view_behavior"    tools:showIn="@layout/app_bar_main">    <androidx.cardview.widget.CardView        android:layout_width="369dp"        android:layout_height="438dp"        android:background="#fff"        android:elevation="@dimen/fab_margin"        app:cardBackgroundColor="#fff"        app:cardCornerRadius="10dp"        app:cardElevation="15dp"        app:cardMaxElevation="3dp"        app:layout_constraintBottom_toBottomOf="parent"        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintStart_toStartOf="parent"        app:layout_constraintTop_toTopOf="parent"        app:layout_constraintVertical_bias="0.797" >        <androidx.constraintlayout.widget.ConstraintLayout            android:layout_width="match_parent"            android:layout_height="match_parent">            <EditText                android:id="@+id/editText4"                android:layout_width="match_parent"                android:layout_height="85dp"                android:text="Password"                android:textAlignment="center"                android:textColorHint="#000"                app:layout_constraintBottom_toBottomOf="parent"                app:layout_constraintTop_toTopOf="parent"                app:layout_constraintVertical_bias="0.441"                tools:layout_editor_absoluteX="0dp">            </EditText>            <EditText                android:id="@+id/editText5"                android:layout_width="match_parent"                android:layout_height="85dp"                android:text="Email"                android:textAlignment="center"                android:textColorHint="#000"                app:layout_constraintBottom_toBottomOf="parent"                app:layout_constraintTop_toTopOf="parent"                app:layout_constraintVertical_bias="0.776"                tools:layout_editor_absoluteX="0dp">            </EditText>            <EditText                android:id="@+id/editText3"                android:layout_width="match_parent"                android:layout_height="85dp"                android:text="@string/username"                android:textAlignment="center"                android:textColorHint="#000"                app:layout_constraintBottom_toBottomOf="parent"                app:layout_constraintTop_toTopOf="parent"                app:layout_constraintVertical_bias="0.144"                tools:layout_editor_absoluteX="0dp">            </EditText>            <Button                android:id="@+id/button"                android:layout_width="wrap_content"                android:layout_height="wrap_content"                android:background="#fff"                android:elevation="15dp"                android:text="Signup"                android:textColor="#000"                app:layout_constraintBottom_toBottomOf="parent"                app:layout_constraintEnd_toEndOf="parent"                app:layout_constraintHorizontal_bias="0.943"                app:layout_constraintStart_toStartOf="parent"                app:layout_constraintTop_toTopOf="parent"                app:layout_constraintVertical_bias="0.958" />        </androidx.constraintlayout.widget.ConstraintLayout>    </androidx.cardview.widget.CardView>    <TextView        android:id="@+id/textView"        android:layout_width="160dp"        android:layout_height="54dp"        android:text="Sign Up"        android:textSize="40dp"        android:textStyle="italic"        app:layout_constraintBottom_toBottomOf="parent"        app:layout_constraintEnd_toEndOf="parent"        app:layout_constraintHorizontal_bias="0.083"        app:layout_constraintStart_toStartOf="parent"        app:layout_constraintTop_toTopOf="parent"        app:layout_constraintVertical_bias="0.156" /></androidx.constraintlayout.widget.ConstraintLayout>

You can choose drawable’s of your choice >Add drawable’s in res>drawable

Now finally run your project(shift+f10) or from menu bar select run , you can use android emulator or you can use your device as emulator.

Output

No comments:

Post a Comment