<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    android:orientation="vertical">

    <com.qmuiteam.qmui.widget.QMUITopBar
        android:id="@+id/add_printer_topbar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/head_height"
        app:qmui_topbar_text_btn_color_state_list="@color/theme_white_color"
        app:qmui_topbar_title_color="@color/theme_white_color" />

    <LinearLayout
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:orientation="horizontal">

        <TextView
            style="@style/print_add_title_textStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.3"
            android:text="名稱" />

        <EditText
            android:id="@+id/add_printer_ed_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_weight="0.7"
            android:background="@null"
            android:digits="@string/edit_digits_number_words"
            android:hint="請輸入打印機名稱"
            android:maxLength="20"
            android:singleLine="true"
            android:textColor="@color/normal_color"
            android:textColorHint="@color/hint_color"
            android:textSize="@dimen/dp_14">

            <requestFocus />
        </EditText>
    </LinearLayout>

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

    <LinearLayout
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:orientation="horizontal">

        <TextView
            style="@style/print_add_title_textStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.3"
            android:text="打印機IP" />

        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.7"
            android:orientation="horizontal">

            <EditText
                android:id="@+id/ip_edit_1"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="bottom|center_horizontal"
                android:hint="0"
                android:inputType="number"
                android:maxLength="3"
                android:minWidth="@dimen/dp_30"
                android:singleLine="true"
                android:text="192"
                android:textColor="@color/normal_color"
                android:textCursorDrawable="@null"
                android:textSize="@dimen/dp_15" />

            <TextView
                android:id="@+id/dot_1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:text="."
                android:textColor="#000"
                android:textSize="@dimen/dp_20"
                android:textStyle="bold" />

            <EditText
                android:id="@+id/ip_edit_2"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="bottom|center_horizontal"
                android:hint="0"
                android:inputType="number"
                android:maxLength="3"
                android:minWidth="@dimen/dp_30"
                android:singleLine="true"
                android:text="168"
                android:textColor="@color/normal_color"
                android:textCursorDrawable="@null"
                android:textSize="@dimen/dp_15" />

            <TextView
                android:id="@+id/dot_2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:text="."
                android:textColor="#000"
                android:textSize="@dimen/dp_20"
                android:textStyle="bold" />

            <EditText
                android:id="@+id/ip_edit_3"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="bottom|center_horizontal"
                android:hint="0"
                android:inputType="number"
                android:maxLength="3"
                android:minWidth="@dimen/dp_30"
                android:singleLine="true"
                android:text="125"
                android:textColor="@color/normal_color"
                android:textCursorDrawable="@null"
                android:textSize="@dimen/dp_15" />

            <TextView
                android:id="@+id/dot_3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:text="."
                android:textColor="#000"
                android:textSize="@dimen/dp_20"
                android:textStyle="bold" />

            <EditText
                android:id="@+id/ip_edit_4"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="bottom|center_horizontal"
                android:hint="0"
                android:inputType="number"
                android:maxLength="3"
                android:minWidth="@dimen/dp_30"
                android:singleLine="true"
                android:text="075"
                android:textColor="@color/normal_color"
                android:textCursorDrawable="@null"
                android:textSize="@dimen/dp_15" />
        </LinearLayout>
    </LinearLayout>

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

    <LinearLayout
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:orientation="horizontal">

        <TextView
            style="@style/print_add_title_textStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.3"
            android:text="端口號" />

        <EditText
            android:id="@+id/add_printer_ed_port"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_weight="0.7"
            android:background="@null"
            android:hint="請輸入端口號，默認9100"
            android:inputType="number"
            android:maxLength="4"
            android:textColor="@color/normal_color"
            android:textColorHint="@color/hint_color"
            android:textSize="@dimen/dp_14" />
    </LinearLayout>

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

    <RelativeLayout
        android:id="@+id/layout_print_device"
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_device_model_text"
            style="@style/print_add_title_textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:text="打印機型號" />


        <ImageView
            android:id="@+id/iv_device_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:src="@drawable/ic_black_next_arrow" />

        <TextView
            android:id="@+id/print_device_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginLeft="@dimen/dp_7"
            android:layout_marginRight="@dimen/dp_7"
            android:layout_toLeftOf="@id/iv_device_arrow"
            android:layout_toRightOf="@id/tv_device_model_text"
            android:gravity="right"
            android:text="請選擇"
            android:textColor="@color/color_c9"
            android:textSize="@dimen/dp_16" />
    </RelativeLayout>

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

    <LinearLayout
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            style="@style/print_add_title_textStyle"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="設為默認" />

        <Switch
            android:id="@+id/switch_set_default"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:thumb="@drawable/shape_thumb_on"
            android:track="@drawable/selector_switch_track"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </LinearLayout>

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

    <RelativeLayout
        android:id="@+id/layout_select_fail_one"
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_fail_one_text"
            style="@style/print_add_title_textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_weight="1"
            android:text="打印失敗由此打印" />


        <ImageView
            android:id="@+id/iv_fail_one_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:src="@drawable/ic_black_next_arrow" />

        <TextView
            android:id="@+id/tv_print_fail_one"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginLeft="@dimen/dp_7"
            android:layout_marginRight="@dimen/dp_7"
            android:layout_toLeftOf="@id/iv_fail_one_arrow"
            android:layout_toRightOf="@id/tv_fail_one_text"
            android:gravity="right"
            android:text="請選擇"
            android:textColor="@color/color_c9"
            android:textSize="@dimen/dp_16"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </RelativeLayout>

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

    <RelativeLayout
        android:id="@+id/layout_select_fail_two"
        style="@style/print_add_printer_input_style"
        android:layout_width="match_parent"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_fail_two_text"
            style="@style/print_add_title_textStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:text="打印失敗由此打印" />

        <ImageView
            android:id="@+id/iv_fail_two_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:src="@drawable/ic_black_next_arrow" />

        <TextView
            android:id="@+id/tv_print_fail_two"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:layout_marginLeft="@dimen/dp_7"
            android:layout_marginRight="@dimen/dp_7"

            android:layout_toLeftOf="@id/iv_fail_two_arrow"
            android:layout_toRightOf="@id/tv_fail_two_text"
            android:gravity="right"
            android:text="請選擇"
            android:textColor="@color/color_c9"
            android:textSize="@dimen/dp_16"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

    </RelativeLayout>

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

    <View
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight="1" />

    <com.qmuiteam.qmui.alpha.QMUIAlphaButton
        android:id="@+id/printer_add"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/printer_add_input_paddingLeft"
        android:layout_marginTop="@dimen/dp_30"
        android:layout_marginRight="@dimen/printer_add_input_paddingLeft"
        android:layout_marginBottom="@dimen/dp_20"
        android:background="@drawable/shape_app_btn"
        android:gravity="center"
        android:paddingTop="@dimen/dp_10"
        android:paddingBottom="@dimen/dp_10"
        android:text="保存"
        android:textColor="@color/white"
        android:textSize="@dimen/dp_16" />

</LinearLayout>