Newer
Older
dcms_cr_app / app / src / main / res / layout / activity_login.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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="80dp"
        android:background="@mipmap/app_logo" />

    <com.google.android.material.textfield.TextInputLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/inputLayout"
        android:layout_marginHorizontal="50dp">

        <EditText
            android:id="@+id/userNameView"
            style="@style/inputEditTextStyle"
            android:drawableStart="@drawable/ic_user"
            android:drawablePadding="5dp"
            android:hint="请输入手机号/用户名"
            android:imeOptions="actionNext"
            android:paddingHorizontal="5dp"
            android:singleLine="true"
            android:textSize="@dimen/titleFontSize"
            android:theme="@style/EditTextTheme" />
    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/inputLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/anchorLayout"
        android:layout_marginHorizontal="50dp"
        app:counterEnabled="true"
        app:counterMaxLength="12"
        app:endIconMode="password_toggle"
        app:errorEnabled="true">

        <EditText
            android:id="@+id/userPasswordView"
            style="@style/inputEditTextStyle"
            android:layout_marginTop="5dp"
            android:drawableStart="@drawable/ic_lock"
            android:drawablePadding="5dp"
            android:hint="请输入密码"
            android:imeOptions="actionDone"
            android:inputType="textPassword"
            android:paddingHorizontal="5dp"
            android:singleLine="true"
            android:textSize="@dimen/titleFontSize"
            android:theme="@style/EditTextTheme" />
    </com.google.android.material.textfield.TextInputLayout>

    <RelativeLayout
        android:id="@+id/anchorLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_marginHorizontal="50dp">

        <CheckBox
            android:id="@+id/rememberPasswordView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:text="记住密码" />

        <CheckBox
            android:id="@+id/autoLoginView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:text="自动登录" />
    </RelativeLayout>

    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
        android:id="@+id/loginButton"
        style="@style/roundButtonStyle"
        android:layout_below="@id/anchorLayout"
        android:layout_margin="30dp"
        android:layout_marginHorizontal="50dp"
        android:text="登录" />

    <com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
        android:id="@+id/changeServerConfigButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignParentBottom="true"
        android:layout_margin="15dp"
        android:background="@drawable/bg_button"
        android:elevation="5dp"
        android:padding="5dp"
        android:src="@drawable/ic_settings" />

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@mipmap/login_bottom" />
</RelativeLayout>