<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.LoginActivity">

    <com.rengwuxian.materialedittext.MaterialEditText
        android:id="@+id/username"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="46dp"
        android:layout_marginTop="475dp"
        android:layout_marginEnd="46dp"
        android:hint="请输入用户名"
        android:imeOptions="actionNext"
        android:selectAllOnFocus="true"
        android:singleLine="true"
        android:textSize="32sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:met_bottomTextSize="26sp" />

    <com.rengwuxian.materialedittext.MaterialEditText
        android:id="@+id/password"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="46dp"
        android:layout_marginTop="50dp"
        android:layout_marginEnd="46dp"
        android:hint="请输入密码"
        android:imeActionLabel="登录"
        android:imeOptions="actionDone"
        android:inputType="textPassword"
        android:selectAllOnFocus="true"
        android:textSize="32sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/username"
        app:met_bottomTextSize="26sp" />

    <Button
        android:id="@+id/login"
        android:layout_width="656dp"
        android:layout_height="100dp"
        android:layout_gravity="start"
        android:layout_marginTop="142dp"
        android:background="@drawable/app_login_btn"
        android:enabled="false"
        android:text="登录"
        android:textColor="@color/white"
        android:textSize="32sp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/password"
        app:layout_constraintVertical_bias="0.2" />

    <ImageView
        android:id="@+id/ivLogo"
        android:layout_width="120dp"
        android:layout_height="120dp"
        android:layout_marginStart="39dp"
        android:layout_marginLeft="39dp"
        android:layout_marginTop="259dp"
        android:background="@mipmap/app_store_round_logo"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="23dp"
        android:layout_marginLeft="26dp"
        android:text="您好，欢迎登录！"
        android:textColor="@color/black"
        android:textSize="48sp"
        app:layout_constraintStart_toEndOf="@+id/ivLogo"
        app:layout_constraintTop_toTopOf="@+id/ivLogo" />

    <TextView
        android:id="@+id/tvSlog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="23dp"
        android:layout_marginLeft="26dp"
        android:text="欢迎使用匡威商米收银"
        android:textColor="#666666"
        android:textSize="28sp"
        app:layout_constraintBottom_toBottomOf="@+id/ivLogo"
        app:layout_constraintStart_toEndOf="@+id/ivLogo" />

    <TextView
        android:id="@+id/tvErrInfo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="账号或密码输入错误，请重新输入"
        android:textColor="#FF5A59"
        android:textSize="24sp"
        android:visibility="gone"
        app:layout_constraintStart_toEndOf="@+id/ivLogo"
        app:layout_constraintStart_toStartOf="@+id/username"
        app:layout_constraintTop_toBottomOf="@+id/password" />


    <!--封装成一个View-->
    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/loading"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone">

        <LinearLayout
            android:layout_width="306dp"
            android:layout_height="279dp"
            android:background="@drawable/app_loading_bg"
            android:gravity="center_horizontal"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <ImageView
                android:layout_width="98dp"
                android:layout_height="98dp"
                android:layout_marginTop="30dp"
                android:src="@mipmap/ic_login" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="23dp"
                android:text="正在登录"
                android:textColor="@color/white"
                android:textSize="36sp" />

            <com.github.ybq.android.spinkit.SpinKitView
                android:id="@+id/spin_kit"
                style="@style/SpinKitView.Large.ThreeBounce"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginTop="18dp"
                app:SpinKit_Color="@color/white" />

        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>