Skip to content

Instantly share code, notes, and snippets.

@adrianhall
Created April 18, 2018 19:39
Show Gist options
  • Save adrianhall/399af5caf8590c923400cbc70becd718 to your computer and use it in GitHub Desktop.
Save adrianhall/399af5caf8590c923400cbc70becd718 to your computer and use it in GitHub Desktop.
Layout for the Sign-in process
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash_background"
android:orientation="vertical"
android:scrollbarAlwaysDrawVerticalTrack="true">
<TextView
android:id="@+id/loginform_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="22dp"
android:gravity="center_horizontal"
android:text="@string/loginform_title"
android:textColor="#fff"
android:textSize="26sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/loginform_title"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="70dp"
android:background="@drawable/rounded_panel"
android:elevation="4dp"
android:orientation="vertical"
android:padding="20dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="30dp">
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/loginform_username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_username_black_24dp"
android:drawableTint="@color/colorAccent"
android:singleLine="true"
android:hint="@string/hint_username"
android:inputType="textEmailAddress"
android:nextFocusForward="@+id/loginform_password"/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/loginform_password"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:singleLine="true"
android:drawableLeft="@drawable/ic_password_black_24dp"
android:drawableTint="@color/colorAccent"
android:hint="@string/hint_password"
android:inputType="textPassword"
android:nextFocusForward="@+id/loginform_signin_button"/>
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/loginform_forgotpassword_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@android:color/transparent"
android:text="@string/forgot_password" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<Button
android:id="@+id/loginform_signin_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@color/colorPrimary"
android:enabled="false"
android:text="@string/action_login"
android:textAllCaps="false"
android:textColor="@android:color/white"
android:textSize="18sp" />
<Button
android:id="@+id/loginform_signup_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@android:color/transparent"
android:text="@string/loginform_signup_msg"/>
</LinearLayout>
</RelativeLayout>
<ImageButton
android:id="@+id/user_profile_photo"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_below="@+id/loginform_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="16dp"
android:background="@drawable/user_profile_image_background"
android:elevation="4dp"
android:scaleType="fitCenter"
android:src="@drawable/profile_icon" />
<ImageButton
android:id="@+id/authenticator_cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/loginform_title"
android:layout_alignParentTop="true"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:background="@android:color/transparent"
app:srcCompat="@drawable/ic_cancel_white_24dp" />
</RelativeLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment