<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:background="@color/supply_chain_bg_color">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/trans">

        <include
            layout="@layout/supply_chain_top_bar"
            app:layout_scrollFlags="scroll|enterAlways" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/dp_10"
            android:layout_marginTop="@dimen/dp_10"
            android:layout_marginRight="@dimen/dp_10"
            android:background="@drawable/shape_white_eight_corners_bg"
            android:orientation="horizontal"
            android:paddingTop="@dimen/dp_10"
            android:paddingBottom="@dimen/dp_10"
            app:layout_scrollFlags="scroll|enterAlways">

            <ImageView
                android:id="@+id/iv_warehouse_img"
                android:layout_width="@dimen/dp_77"
                android:layout_height="@dimen/dp_77"
                android:layout_marginLeft="@dimen/dp_13" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginLeft="@dimen/dp_16"
                android:layout_marginRight="@dimen/dp_8"
                android:orientation="vertical">

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

                    <TextView
                        style="@style/WareHouse_Details_TextStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="庫存:" />

                    <TextView
                        android:id="@+id/tv_warehouse_inventory_number"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="@color/other_order_details_sure_btn_color"
                        android:textSize="@dimen/dp_19"
                        tools:text="100" />

                    <TextView
                        android:id="@+id/tv_food_unit"
                        style="@style/WareHouse_Details_TextStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        tools:text="盒" />

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

                    <TextView
                        style="@style/WareHouse_Details_TextStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="規格:" />

                    <TextView
                        android:id="@+id/tv_warehouse_specifications"
                        style="@style/WareHouse_Details_TextStyle"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        tools:text="1KG/盒" />
                </LinearLayout>

                <TextView
                    android:id="@+id/tv_warehouse_unit_price"
                    style="@style/WareHouse_Details_TextStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:gravity="center_vertical"
                    tools:text="最新單價:$10.00" />

                <TextView
                    android:id="@+id/tv_warehouse_total_amount"
                    style="@style/WareHouse_Details_TextStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    tools:text="總價:$1000.00" />
            </LinearLayout>
        </LinearLayout>

        <LinearLayout
            android:id="@+id/layout_warehousing_title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/dp_10"
            android:layout_marginTop="@dimen/dp_10"
            android:layout_marginRight="@dimen/dp_10"
            android:orientation="horizontal"
            app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

            <TextView
                android:id="@+id/tv_warehousing_record"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="@drawable/shape_left_themecolor_radius_btn"
                android:gravity="center"
                android:paddingTop="@dimen/dp_11"
                android:paddingBottom="@dimen/dp_11"
                android:text="入庫流水"
                android:textColor="@color/white"
                android:textSize="@dimen/dp_17" />

            <TextView
                android:id="@+id/tv_outbound_record"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="@drawable/shape_right_white_radius_btn"
                android:gravity="center"
                android:paddingTop="@dimen/dp_11"
                android:paddingBottom="@dimen/dp_11"
                android:text="出庫流水"
                android:textColor="@color/color_3c"
                android:textSize="@dimen/dp_17" />
        </LinearLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <com.scwang.smartrefresh.layout.SmartRefreshLayout
        android:id="@+id/srl_warehouse_details_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        app:srlAccentColor="@color/theme_333_color"
        app:srlEnablePreviewInEditMode="true"
        app:srlPrimaryColor="@color/trans">

        <androidx.core.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">
            <!-- scrollview在代碼中要添加多個子view，所以多用一個LinearLayout包裹起來-->
            <LinearLayout
                android:id="@+id/layout_warehousing_root"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                app:layout_behavior="@string/appbar_scrolling_view_behavior">

                <androidx.viewpager2.widget.ViewPager2
                    android:id="@+id/vp_warehouse_viewpager"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="@dimen/dp_10"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior" />
            </LinearLayout>

        </androidx.core.widget.NestedScrollView>

    </com.scwang.smartrefresh.layout.SmartRefreshLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
