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

    <androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/color_f0"
        app:cardElevation="@dimen/dp_2"
        tools:context=".ui.activity.DeliveryOrderMainActivity">

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

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

            <com.google.android.material.tabs.TabLayout
                android:id="@+id/coldchain_main_tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:tabBackground="@color/white"
                app:tabTextColor="@color/color_75"
                app:tabSelectedTextColor="@color/theme_333_color"
                app:tabIndicatorColor="@color/theme_color"
                app:tabPaddingEnd="-1dp"
                app:tabPaddingStart="-1dp" />

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/layout_search_info"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:padding="@dimen/dp_10"
                app:layout_constraintTop_toTopOf="parent">

                <ProgressBar
                    android:id="@+id/cold_chain_takeaway_progress"
                    style="?android:attr/progressBarStyleHorizontal"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_5"
                    android:layout_marginRight="@dimen/dp_5"
                    android:progressDrawable="@drawable/shape_seekbar_bg"
                    app:layout_constraintCircleRadius="@dimen/dp_5"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toLeftOf="@id/dividing_line"
                    app:layout_constraintTop_toTopOf="parent"
                    app:qmui_background_color="@color/color_e4"
                    app:qmui_progress_color="@color/theme_color"
                    app:qmui_stroke_round_cap="true"
                    app:qmui_type="type_rect" />

                <TextView
                    android:id="@+id/tv_month_takeaway_num_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_5"
                    android:text="外賣訂單數："
                    android:textColor="@color/color_a9"
                    android:textSize="@dimen/dp_12"
                    app:layout_constraintRight_toLeftOf="@id/tv_cold_chain_takeaway_num"
                    app:layout_constraintTop_toBottomOf="@id/cold_chain_takeaway_progress" />

                <TextView
                    android:id="@+id/tv_cold_chain_takeaway_num"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/color_a9"
                    android:textSize="@dimen/dp_12"
                    app:layout_constraintRight_toRightOf="@id/cold_chain_takeaway_progress"
                    app:layout_constraintTop_toTopOf="@id/tv_month_takeaway_num_text" />

                <View
                    android:id="@+id/dividing_line"
                    android:layout_width="@dimen/dp_1"
                    android:layout_height="0dp"
                    android:background="@color/color_cf"
                    app:layout_constraintBottom_toBottomOf="@id/cold_chain_takeaway_progress"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@id/cold_chain_takeaway_progress" />

                <ProgressBar
                    android:id="@+id/cold_chain_self_progress"
                    style="?android:attr/progressBarStyleHorizontal"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_5"
                    android:layout_marginLeft="@dimen/dp_5"
                    android:progressDrawable="@drawable/shape_seekbar_bg"
                    app:layout_constraintCircleRadius="@dimen/dp_5"
                    app:layout_constraintLeft_toRightOf="@id/dividing_line"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:qmui_background_color="@color/color_e4"
                    app:qmui_progress_color="@color/theme_color"
                    app:qmui_type="type_circle" />

                <TextView
                    android:id="@+id/tv_month_self_num_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_5"
                    android:text="自取訂單數："
                    android:textColor="@color/color_a9"
                    android:textSize="@dimen/dp_12"
                    app:layout_constraintRight_toLeftOf="@id/tv_cold_chain_self_num"
                    app:layout_constraintTop_toBottomOf="@id/cold_chain_self_progress" />

                <TextView
                    android:id="@+id/tv_cold_chain_self_num"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/color_a9"
                    android:textSize="@dimen/dp_12"
                    app:layout_constraintRight_toRightOf="@id/cold_chain_self_progress"
                    app:layout_constraintTop_toTopOf="@id/tv_month_self_num_text" />

                <EditText
                    android:id="@+id/ed_cold_chain_order_num_search"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_35"
                    android:layout_marginTop="@dimen/dp_10"
                    android:layout_marginRight="@dimen/dp_10"
                    android:background="@drawable/shape_search_bg"
                    android:hint="請輸入手機號或訂單號"
                    android:inputType="number"
                    android:paddingLeft="@dimen/dp_10"
                    android:paddingRight="@dimen/dp_50"
                    android:textColor="@color/theme_333_color"
                    android:textColorHint="@color/color_ccc"
                    android:textSize="@dimen/dp_14"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toLeftOf="@id/tv_cold_chain_restaurant_state"
                    app:layout_constraintTop_toBottomOf="@id/tv_month_takeaway_num_text" />

                <ImageView
                    android:id="@+id/iv_cold_chain_search_order"
                    android:layout_width="@dimen/dp_50"
                    android:layout_height="0dp"
                    android:padding="@dimen/dp_10"
                    android:src="@drawable/ic_search"
                    app:layout_constraintBottom_toBottomOf="@id/ed_cold_chain_order_num_search"
                    app:layout_constraintRight_toRightOf="@id/ed_cold_chain_order_num_search"
                    app:layout_constraintTop_toTopOf="@id/ed_cold_chain_order_num_search" />


                <TextView
                    android:id="@+id/tv_cold_chain_restaurant_state"
                    style="@style/otherOrder_restaurant_state_style"
                    android:layout_marginRight="@dimen/dp_2"
                    android:background="@drawable/shape_restaurant_state_bg"
                    android:text="營業中 "
                    app:layout_constraintBottom_toBottomOf="@id/ed_cold_chain_order_num_search"
                    app:layout_constraintRight_toLeftOf="@id/cb_auto_receiving_orders"
                    app:layout_constraintTop_toTopOf="@id/ed_cold_chain_order_num_search" />

                <ImageView
                    android:layout_width="@dimen/dp_10"
                    android:layout_height="@dimen/dp_5"
                    android:layout_centerVertical="true"
                    android:layout_marginRight="@dimen/dp_4"
                    android:src="@drawable/qmui_popup_arrow_down"
                    app:layout_constraintBottom_toBottomOf="@id/tv_cold_chain_restaurant_state"
                    app:layout_constraintRight_toRightOf="@id/tv_cold_chain_restaurant_state"
                    app:layout_constraintTop_toTopOf="@id/tv_cold_chain_restaurant_state" />

                <androidx.appcompat.widget.AppCompatCheckBox
                    android:id="@+id/cb_auto_receiving_orders"
                    style="@style/MyCheckbox_style"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layoutDirection="ltr"
                    android:text="自動接單"
                    android:textColor="@color/color_a9"
                    app:layout_constraintBottom_toBottomOf="@id/tv_cold_chain_restaurant_state"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@id/tv_cold_chain_restaurant_state" />

            </androidx.constraintlayout.widget.ConstraintLayout>

            <TextView
                android:id="@+id/tv_balance"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="@dimen/dp_10"
                android:text="餘額："
                android:textColor="@color/theme_333_color"
                android:textSize="@dimen/dp_16" />

        </com.google.android.material.appbar.AppBarLayout>
    </androidx.cardview.widget.CardView>

    <androidx.viewpager.widget.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    <LinearLayout
        android:id="@+id/cold_chain_btn_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="@dimen/dp_10"
        app:layout_constraintBottom_toBottomOf="parent">

        <Button
            android:id="@+id/btn_supplement_order"
            style="@style/app_btn_style"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:background="@color/theme_color"
            android:text="補單" />

        <Button
            android:id="@+id/btn_pick_up"
            style="@style/app_btn_style"
            android:layout_width="0dp"
            android:layout_marginLeft="@dimen/dp_5"
            android:layout_weight="1"
            android:background="@color/theme_color"
            android:text="物流取件" />
    </LinearLayout>
</LinearLayout>