<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ This file is part of FYReader.
  ~  FYReader is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  FYReader is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~  You should have received a copy of the GNU General Public License
  ~  along with FYReader.  If not, see <https://www.gnu.org/licenses/>.
  ~
  ~  Copyright (C) 2020 - 2022 fengyuecanzhu
  -->

<LinearLayout 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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <include layout="@layout/toolbar" />


    <!--添加标题和输入框-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:orientation="vertical"
        android:padding="10dp">

        <!--标题-->

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/text_register"
            android:textAlignment="center"
            android:textColor="@color/textPrimary"
            android:textSize="@dimen/text_senior_size" />

        <TextView
            android:id="@+id/tv_register_tip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:text=""
            android:textColor="@color/textError"
            android:visibility="gone" />
        <!--添加输入框-->
        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/et_username"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:drawablePadding="10dp"
            app:counterEnabled="true"
            app:counterMaxLength="14">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/et_account_tip"
                android:inputType="text" />
        </com.google.android.material.textfield.TextInputLayout>


        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/et_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawablePadding="10dp"
            app:counterEnabled="true"
            app:counterMaxLength="16"
            app:passwordToggleEnabled="true"
            app:passwordToggleTintMode="src_in">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/et_password_tip"
                android:inputType="textPassword" />

        </com.google.android.material.textfield.TextInputLayout>

        <com.google.android.material.textfield.TextInputLayout
            android:id="@+id/et_email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:drawablePadding="10dp"
            app:counterEnabled="true"
            app:counterMaxLength="100">

            <com.google.android.material.textfield.TextInputEditText
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/et_email"
                android:inputType="text" />

        </com.google.android.material.textfield.TextInputLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/et_email_code"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:drawablePadding="10dp"
                app:counterEnabled="true"
                app:counterMaxLength="6">

                <com.google.android.material.textfield.TextInputEditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/et_email_captcha"
                    android:inputType="text" />

            </com.google.android.material.textfield.TextInputLayout>

            <TextView
                android:id="@+id/tv_get_email_code"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:textColor="@color/selector_get_emali_code"
                android:text="@string/get_email_code"
                android:textSize="@dimen/text_small_size"
                android:layout_weight="2.5" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/et_captcha"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:drawablePadding="10dp"
                app:counterEnabled="true"
                app:counterMaxLength="4">

                <com.google.android.material.textfield.TextInputEditText
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/et_rp_captcha"
                    android:inputType="text" />

            </com.google.android.material.textfield.TextInputLayout>


            <ImageView
                android:id="@+id/iv_captcha"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight="2.5"
                android:paddingStart="7dp"
                tools:ignore="RtlSymmetry" />

        </LinearLayout>

        <!--登录按钮-->
        <Button
            android:id="@+id/bt_register"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/login_btn_selector"
            android:enabled="false"
            android:text="@string/text_register"
            android:textAlignment="center"
            android:textColor="#ffffff"
            android:textSize="@dimen/text_large_size" />


        <CheckBox
            android:id="@+id/cb_agreement"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:textColorLink="@color/colorAccent"
            android:text="@string/text_agreement_tip"
            android:textColor="@color/textPrimary"
            android:theme="@style/MyCheckBox" />

    </LinearLayout>

</LinearLayout>