Simple Android Login Page

Login XML

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="#b2ebf2"

android:fitsSystemWindows="true">


<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="vertical"

android:paddingLeft="24dp"

android:paddingTop="80dp"

android:paddingRight="24dp">


<ImageView

android:layout_width="wrap_content"

android:layout_height="150dp"

android:layout_gravity="center_horizontal"

android:layout_marginBottom="25dp"

android:src="@mipmap/ic_launcher" />


<!-- Email Label -->

<android.support.design.widget.TextInputLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="8dp"

android:layout_marginBottom="8dp">


<EditText

android:id="@+id/password"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:hint="Email"

android:inputType="textEmailAddress" />

</android.support.design.widget.TextInputLayout>


<!-- Password Label -->

<android.support.design.widget.TextInputLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:layout_marginTop="8dp"

android:layout_marginBottom="8dp">


<EditText

android:id="@+id/input_password"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:hint="Password"

android:inputType="textPassword" />

</android.support.design.widget.TextInputLayout>


<android.support.v7.widget.AppCompatButton

android:id="@+id/btn_login"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_marginTop="24dp"

android:layout_marginBottom="24dp"

android:padding="12dp"

android:text="Login" />


<TextView

android:id="@+id/link_signup"

android:layout_width="fill_parent"

android:layout_height="wrap_content"

android:layout_marginBottom="24dp"

android:gravity="center"

android:text="No account yet? Create one"

android:textSize="16dip" />


</LinearLayout>

</ScrollView>

Manifest

<activity

android:name=".Login"

android:label="@string/title_activity_login"

android:parentActivityName=".MainActivity"

android:theme="@style/AppTheme.NoActionBar">

<meta-data

android:name="android.support.PARENT_ACTIVITY"

android:value="com.thiyagaraaj.apptrace.MainActivity" />

</activity>

Bind to Java

@BindView(R.id.input_email) EditText _emailText;

@BindView(R.id.input_password) EditText _passwordText;

@BindView(R.id.btn_login) Button _loginButton;

@BindView(R.id.link_signup) TextView _signupLink;

To read values

String email = _emailText.getText().toString();

String password = _passwordText.getText().toString();

Demo Screen