<?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/color_f5">

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/tv_food_unit_complete"
        android:layout_below="@id/supply_top_bar"
        android:orientation="vertical">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp_50"
            android:background="@color/white"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/dp_15"
                android:text="基本單位"
                android:textColor="@color/color_3c"
                android:textSize="@dimen/dp_16" />

            <EditText
                android:id="@+id/ed_basic_unit"
                style="@style/AppEditTextStyle"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginLeft="@dimen/dp_10"
                android:layout_marginRight="@dimen/dp_10"
                android:background="@null"
                android:hint="請輸入基本單位"
                android:maxLength="5" />

        </LinearLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/dp_20"
            android:layout_marginTop="@dimen/dp_5"
            android:layout_marginRight="@dimen/dp_20"
            android:layout_marginBottom="@dimen/dp_5"
            android:gravity="center_horizontal"
            android:text="請將最小計量單位設為基本單位，如個、張、卡等"
            android:textColor="@color/color_3c"
            android:textSize="@dimen/dp_12" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp_0"
            android:layout_marginBottom="@dimen/dp_20"
            android:layout_weight="1">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="@dimen/dp_24"
                android:orientation="vertical">

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_deputy_unit_list"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
            </LinearLayout>

            <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
                android:id="@+id/tv_add_deputy"
                android:layout_width="wrap_content"
                android:layout_height="@dimen/dp_24"
                android:layout_gravity="center_horizontal|bottom"
                android:background="@drawable/shape_add_deputy_unit_btn"
                android:gravity="center_vertical"
                android:paddingLeft="@dimen/dp_10"
                android:paddingRight="@dimen/dp_10"
                android:text="+添加一個副單位"
                android:textColor="@color/white"
                android:textSize="@dimen/dp_12" />
        </FrameLayout>


        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_basic_unit_list"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginLeft="@dimen/dp_20"
            android:layout_marginRight="@dimen/dp_20"
            android:layout_weight="1" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/dp_20"
            android:layout_marginTop="@dimen/dp_30"
            android:layout_marginRight="@dimen/dp_20"
            android:layout_marginBottom="@dimen/dp_5"
            android:gravity="center_horizontal"
            android:text="副单位为辅助单位，可设置为基本单位的整倍数。例如:基本单位为个，副单位为箱，200个=1箱，则与基本单位的换算倍数填200。"
            android:textColor="@color/color_3c"
            android:textSize="@dimen/dp_12" />
    </LinearLayout>

    <com.qmuiteam.qmui.alpha.QMUIAlphaTextView
        android:id="@+id/tv_food_unit_complete"
        style="@style/app_btn_style"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginLeft="@dimen/dp_10"
        android:layout_marginRight="@dimen/dp_10"
        android:layout_marginBottom="@dimen/dp_10"
        android:gravity="center"
        android:paddingTop="@dimen/dp_10"
        android:paddingBottom="@dimen/dp_10"
        android:text="完成" />
</RelativeLayout>