Best Android Login Page Design XML Code

Android Login Page Design


Hello Guys, i am jagdish der and i am android programmer and i want share my android knowledge with you. Android Studio is the platform for create an android applications and UI Design is the way to attract your application users and very important part of Android programming.

Every people love attractive User Interface Design, it's the first impression of your Android application.

Required Gradle Files 

compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'

Login Activity 

In any Android application you know that the User login Or User regstration is generally available, If you want to build your own Android application then you can build the attractive login page like below image.



How to Deign Attractive Login Page ?

  • First of all you need to create new android project in Android Studio.
  • Select Empty Activity.  
  • Give project name and main activity name.
  • After gradle successfull you need to write xml code for edit text or you can design through Drag and Drop.

Xml code for activity_login.xml 

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:id="@+id/activity_login"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@drawable/bluecolorbest"
    tools:context="com.example.jagdish.makemyplace.Activity.Login">

    <android.support.v7.widget.CardView
        android:layout_margin="10dp"
        app:cardCornerRadius="4dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_gravity="center"
            android:padding="10dp"
            android:weightSum="1">

                <EditText
                    android:layout_margin="10dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edittextstyle"
                    android:hint="Enter Email ID"
                    android:drawableLeft="@drawable/ic_email"
                    android:drawableTint="@color/colorPrimaryDark"
                    android:drawablePadding="5dp"
                    android:textColorHint="@color/colorPrimaryDark"
                    android:id="@+id/emailedit"
                    android:inputType="textEmailAddress"
                    android:singleLine="true"/>

                <EditText
                    android:layout_margin="10dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@drawable/edittextstyle"
                    android:hint="Enter Password"
                    android:drawableLeft="@drawable/ic_lock"
                    android:drawableTint="@color/colorPrimaryDark"
                    android:drawablePadding="5dp"
                    android:textColorHint="@color/colorPrimaryDark"
                    android:id="@+id/passedit"
                    android:inputType="textEmailAddress"
                    android:singleLine="true"
                    android:password="true"
                    android:drawableRight="@drawable/ic_visibility_off"
                    />


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/forgot"
                android:textColor="@color/colorPrimaryDark"
                android:text="Forgot Password?"
                android:layout_gravity="right"
                android:layout_marginTop="5dp"/>

            <Button
                android:layout_margin="15dp"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:id="@+id/loginbtn"
                android:background="@drawable/buttonstyle"
                android:text="Login Securely"
                android:textColor="@android:color/white"
                android:textSize="18dp"
                android:textAllCaps="false"
                android:layout_marginTop="20dp"
                />
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text=" OR "
                android:gravity="center" />
            <Button
                android:layout_marginTop="10dp"
                android:layout_width="180dp"
                android:layout_height="50dp"
                android:id="@+id/reg"
                android:backgroundTint="@android:color/white"
                android:background="@drawable/buttonstyle"
                android:layout_gravity="center"
                android:text="Create a New Account"
                android:textColor="@color/colorPrimary"
                android:textAllCaps="false"
                />
            <com.google.android.gms.common.SignInButton
                android:layout_width="180dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="10dp"
                android:id="@+id/googleBtn"/>

            <com.facebook.login.widget.LoginButton
                android:id="@+id/login_button"
                android:layout_width="180dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="10dp"
                android:paddingTop="10dp"
                android:paddingBottom="10dp"
                android:layout_weight="0.16" />

        </LinearLayout>

    </android.support.v7.widget.CardView>
</LinearLayout>

AndroidManifest.xml file for Login Activity


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.jagdish.makemyplace">

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />
 
 <application
        android:allowBackup="true"
        android:icon="@mipmap/mmplace"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
  
  <activity
            android:name=".Activity.Login"
            android:label="Login to MMP">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
  
 </aplication>
 
</manifest>

No comments:

Powered by Blogger.