Simple login page in android
How we can create simple login page in android
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_centerInParent="true"
android:layout_marginRight="10dp" android:layout_marginLeft="10dp"
>
<EditText
android:id="@+id/email_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:hint="Email id "
android:inputType="textEmailAddress"
/>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:padding="20dp"
android:hint="Password"
android:inputType="textPassword"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Forget Password?"
android:textSize="20sp"
android:layout_gravity="right"
android:textColor="#659FE0"
android:layout_marginRight="10dp"
/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Log in"
android:textSize="20sp"
android:background="#2C40D3"
android:textColor="#EBE7E7"
android:layout_marginTop="20dp"
/>
</LinearLayout>
</RelativeLayout>
MainActivity.java
-----------------------------
package com.example.simpleloginpage;
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);
}
}
Output
Post a Comment