<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/supply_chain_bg_color"
    android:orientation="vertical">

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

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true">

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

            <LinearLayout
                android:id="@+id/layout_inventory_details"
                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="@string/str_inventory_colon" />

                        <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="@string/str_specification_colon" />

                        <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">

                <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="@string/str_warehousing_bill"
                    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="@string/str_out_warehousing_bill"
                    android:textColor="@color/color_3c"
                    android:textSize="@dimen/dp_17" />
            </LinearLayout>

            <com.scwang.smartrefresh.layout.SmartRefreshLayout
                android:id="@+id/srl_warehouse_details_list"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                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">

                    <!-- 這裡多用一個lineaarlayout是因為需要給消耗的視圖留位置-->
                    <LinearLayout
                        android:id="@+id/layout_warehousing_root"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:animateLayoutChanges="true"
                        android:orientation="vertical">

                        <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" />
                    </LinearLayout>
                </androidx.core.widget.NestedScrollView>
            </com.scwang.smartrefresh.layout.SmartRefreshLayout>
        </LinearLayout>
    </ScrollView>

</LinearLayout>
