<?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/supply_chain_bg_color"
    android:orientation="vertical">

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

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/layout_food_ingredients_search"
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp_40"
            android:layout_margin="@dimen/dp_10"
            android:background="@drawable/shape_white_eight_corners_bg"
            android:orientation="horizontal"
            android:visibility="gone">

            <ImageView
                android:layout_width="@dimen/dp_20"
                android:layout_height="@dimen/dp_20"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="@dimen/dp_10"
                android:src="@drawable/ic_search" />

            <EditText
                android:id="@+id/ed_food_ingredients_search"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_marginLeft="@dimen/dp_5"
                android:layout_marginRight="@dimen/dp_5"
                android:layout_weight="1"
                android:background="@null"
                android:hint="搜索食材"
                android:textColor="@color/theme_333_color"
                android:textColorHint="@color/hint_color"
                android:textSize="@dimen/dp_16" />

            <com.qmuiteam.qmui.alpha.QMUIAlphaButton
                android:id="@+id/btn_food_ingredients_search"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginTop="@dimen/dp_1"
                android:layout_marginBottom="@dimen/dp_1"
                android:background="@drawable/shape_app_btn"
                android:text="搜索"
                android:textColor="@color/white"
                android:textSize="@dimen/dp_14" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/srl_supplier"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@id/layout_food_ingredients_btn"
            android:layout_below="@id/layout_food_ingredients_search"
            android:layout_marginTop="@dimen/dp_10"
            android:orientation="horizontal">

            <LinearLayout
                android:id="@+id/layout_ingredients_left"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical">

                <com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout
                    android:id="@+id/layout_switch_method"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/dp_5"
                    android:layout_marginRight="@dimen/dp_5"
                    android:background="@drawable/shape_app_btn"
                    android:gravity="center"
                    android:orientation="vertical"
                    android:paddingLeft="@dimen/dp_4"
                    android:paddingTop="@dimen/dp_5"
                    android:paddingRight="@dimen/dp_4"
                    android:paddingBottom="@dimen/dp_5">

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:src="@drawable/ic_switch_arrow" />

                    <TextView
                        android:id="@+id/tv_switch_food_ingredients_show_type"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="@dimen/dp_5"
                        android:gravity="center"
                        android:text="@string/str_species"
                        android:textColor="@color/white"
                        android:textSize="@dimen/dp_14" />
                </com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout>

                <FrameLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

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

                    <!-- 二級分類單獨裝-->
                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/rv_food_ingredients_second_category"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:visibility="gone"
                        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
                </FrameLayout>
            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv_food_ingredients"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="4"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/layout_food_ingredients_btn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_marginLeft="@dimen/dp_20"
            android:layout_marginTop="@dimen/dp_10"
            android:layout_marginRight="@dimen/dp_20"
            android:layout_marginBottom="@dimen/dp_20"
            android:orientation="horizontal">

            <com.qmuiteam.qmui.alpha.QMUIAlphaButton
                android:id="@+id/btn_new_food_ingredient"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/shape_app_btn"
                android:gravity="center"
                android:text="+新增食材"
                android:textColor="@color/white"
                android:textSize="@dimen/dp_16"
                android:visibility="gone" />

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

                <com.qmuiteam.qmui.alpha.QMUIAlphaButton
                    android:id="@+id/btn_food_ingredients_confirm"
                    style="@style/Save_Btn_Style"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_5"
                    android:layout_marginRight="@dimen/dp_5"
                    android:layout_marginBottom="@dimen/dp_5"
                    android:text="確定"
                    android:visibility="visible" />

                <TextView
                    android:id="@+id/tv_ingredients_food_num"
                    android:layout_width="@dimen/dp_20"
                    android:layout_height="@dimen/dp_20"
                    android:layout_gravity="right"
                    android:autoSizeMaxTextSize="@dimen/dp_8"
                    android:autoSizeMinTextSize="@dimen/dp_4"
                    android:background="@drawable/ui_shape_red_oval"
                    android:gravity="center"
                    android:text="3"
                    android:textColor="@color/white"
                    android:textSize="@dimen/dp_12"
                    android:visibility="gone"
                    app:layout_constraintRight_toRightOf="@id/iv_shopping_cart"
                    app:layout_constraintTop_toTopOf="@id/iv_shopping_cart" />
            </FrameLayout>


            <com.qmuiteam.qmui.alpha.QMUIAlphaButton
                android:id="@+id/btn_food_ingredients_cancel"
                style="@style/Cancel_Btn_Style"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/dp_20"
                android:layout_marginTop="@dimen/dp_5"
                android:layout_marginBottom="@dimen/dp_5"
                android:layout_weight="1"
                android:text="取消"
                android:visibility="visible" />
        </LinearLayout>

    </RelativeLayout>

</LinearLayout>