A Login Design is mainly where user full some credentials for an App or Website, Here in this post i will show you a simple Login Design for your Application. Here we create Login and and Sign Up for your App.The Design Look like this.
Here we will have two activities one for Login and other for Sign Up, we will call onClick method to move from one screen to another, Lets see the code.
oooooooooooooooooooooooooooooooooo
oooooooooooooooooooooooooooooooooo
MainActivity.java
- import android.content.Intent;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- import android.view.View;
- public class MainActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_main);
- }
- public void click(View view) {
- Intent in = new Intent(MainActivity.this,SecondActivity.class);
- startActivity(in);
- }
- }
activity.xml
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout 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:orientation="vertical"
- android:layout_height="match_parent"
- tools:context="com.example.user.application.MainActivity">
- <ImageView
- android:background="@drawable/back"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <TextView
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:padding="5dp"
- android:layout_marginTop="120dp"
- android:hint="Email"
- android:background="#FFF"
- android:textSize="30dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <TextView
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:padding="5dp"
- android:layout_marginTop="20dp"
- android:hint="Password"
- android:background="#FFF"
- android:textSize="30dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <Button
- android:layout_marginTop="30dp"
- android:text="login"
- android:textSize="30dp"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <TextView
- android:backgroundTintMode="multiply"
- android:gravity="center"
- android:textSize="15dp"
- android:textColor="#FFF"
- android:layout_marginTop="30dp"
- android:onClick="click"
- android:text="Not a member?Sign Up now"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- </LinearLayout>
- </RelativeLayout>
SecondActivity.java
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- public class SecondActivity extends AppCompatActivity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_second);
- }
- }
activity_second.xml
- <?xml version="1.0" encoding="utf-8"?>
- <RelativeLayout 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"
- tools:context="com.example.user.application.SecondActivity">
- <ImageView
- android:background="@drawable/back_second"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <TextView
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:padding="5dp"
- android:layout_marginTop="120dp"
- android:hint="Enter Name"
- android:background="@drawable/color"
- android:textSize="25dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <TextView
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:padding="5dp"
- android:layout_marginTop="20dp"
- android:hint="Email"
- android:background="@drawable/color"
- android:textSize="25dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <TextView
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:padding="5dp"
android:layout_marginTop="20dp"- android:hint="Password"
- android:background="@drawable/color"
- android:textSize="25dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <Button
- android:textColor="#FFF"
- android:background="#Fe30"
- android:layout_marginTop="30dp"
- android:text="register"
- android:textSize="30dp"
- android:layout_marginLeft="20dp"
- android:layout_marginRight="20dp"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- <TextView
- android:gravity="center"
- android:textSize="15dp"
- android:textColor="#FFF"
- android:layout_marginTop="30dp"
- android:text="Already member!Login Me"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" />
- </LinearLayout>
- </RelativeLayout>
![]()
back.xml
- <?xml version="1.0" encoding="utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android">
- <gradient
- android:startColor="#25ae90"
- android:endColor="#4a6c5e"
- android:angle="90">
- </gradient>
- </shape>
back_second.xml
- <?xml version="1.0" encoding="utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android">
- <gradient
- android:startColor="#171818"
- android:endColor="#4a6c5e"
- android:angle="90">
- </gradient>
- </shape>
For more details check out the Video below. Do subscribe to my channel.
Hope this post is helpful,for more useful post like and share with your friends, we also have Youtube channel for more details check out the video below, do like share and subscribe to our channel it will boost our energy and help to improve our work, Have Nice Day.
Simple Login Design Tutorial Using Android Studio.
Reviewed by gcrt
on
March 20, 2018
Rating:

No comments: