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

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

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@id/layout_btn"
        android:layout_below="@id/send_order_top_bar"
        app:layout_constraintTop_toBottomOf="@id/send_order_top_bar">

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

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv_send_order_foods"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="@dimen/dp_10"
                android:paddingRight="@dimen/dp_10" />

            <View
                android:id="@+id/view_send_order_foods_line"
                android:layout_width="match_parent"
                android:layout_height="@dimen/dp_5"
                android:layout_below="@id/rv_send_order_foods"
                android:layout_marginTop="@dimen/dp_10"
                android:background="@color/color_ccc" />

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv_send_order_bills"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/view_send_order_foods_line"
                android:fadeScrollbars="false"
                android:orientation="vertical"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                app:layout_constraintTop_toBottomOf="@id/view_send_order_foods_line" />

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/rv_send_order_bills"
                android:layout_marginTop="@dimen/dp_20"
                android:paddingLeft="@dimen/dp_10"
                android:layout_marginBottom="@dimen/dp_10"
                android:paddingRight="@dimen/dp_10"
                app:layout_constraintTop_toBottomOf="@id/rv_send_order_bills">


                <TextView
                    android:id="@+id/tv_send_order_phone_text"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/customer_phone"
                    app:layout_constraintBottom_toBottomOf="@id/ed_send_order_phone"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toTopOf="@id/ed_send_order_phone" />

                <EditText
                    android:id="@+id/ed_send_order_phone"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:background="@null"
                    android:gravity="right"
                    android:hint="@string/please_input_phone"
                    android:inputType="phone"
                    android:labelFor="@id/tv_send_order_name_text"
                    android:padding="@dimen/edit_padding"
                    app:layout_constraintLeft_toRightOf="@id/tv_send_order_name_text"
                    app:layout_constraintRight_toLeftOf="@id/iv_send_order_search"
                    app:layout_constraintTop_toTopOf="parent" />

                <ImageView
                    android:id="@+id/iv_send_order_search"
                    android:layout_width="@dimen/dp_40"
                    android:layout_height="0dp"
                    android:padding="@dimen/dp_10"
                    android:src="@drawable/ic_search"
                    app:layout_constraintBottom_toBottomOf="@id/ed_send_order_phone"
                    app:layout_constraintLeft_toRightOf="@id/ed_send_order_phone"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@id/ed_send_order_phone" />


                <TextView
                    android:id="@+id/tv_send_order_name_text"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/customer_name"
                    app:layout_constraintBottom_toBottomOf="@id/ed_send_order_name"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toTopOf="@id/ed_send_order_name" />

                <EditText
                    android:id="@+id/ed_send_order_name"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:background="@null"
                    android:gravity="right"
                    android:hint="@string/please_input_name_or_select_members"
                    android:inputType="text"
                    android:labelFor="@id/tv_send_order_name_text"
                    android:padding="@dimen/edit_padding"
                    app:layout_constraintLeft_toRightOf="@id/tv_send_order_name_text"
                    app:layout_constraintRight_toLeftOf="@id/iv_select_member_arrow"
                    app:layout_constraintTop_toBottomOf="@id/ed_send_order_phone" />

                <ImageView
                    android:id="@+id/iv_select_member_arrow"
                    android:layout_width="@dimen/dp_30"
                    android:layout_height="0dp"
                    android:padding="@dimen/dp_8"
                    android:src="@drawable/ic_black_next_arrow"
                    app:layout_constraintBottom_toBottomOf="@id/ed_send_order_name"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@id/ed_send_order_name" />

                <View
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_1"
                    android:background="@color/color_ccc"
                    app:layout_constraintLeft_toLeftOf="@id/ed_send_order_name"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/ed_send_order_name" />

                <View
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_1"
                    android:background="@color/color_ccc"
                    app:layout_constraintLeft_toLeftOf="@id/ed_send_order_phone"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/ed_send_order_phone" />


                <TextView
                    android:id="@+id/tv_send_order_address_text"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/delivery_address"
                    app:layout_constraintBottom_toBottomOf="@id/ed_send_order_address"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toTopOf="@id/ed_send_order_address" />

                <EditText
                    android:id="@+id/ed_send_order_address"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:background="@null"
                    android:gravity="right"
                    android:hint="@string/please_input_details_address"
                    android:inputType="text"
                    android:labelFor="@id/tv_send_order_name_text"
                    android:padding="@dimen/edit_padding"
                    app:layout_constraintLeft_toRightOf="@id/tv_send_order_name_text"
                    app:layout_constraintRight_toLeftOf="@id/iv_select_member_arrow"
                    app:layout_constraintTop_toBottomOf="@id/ed_send_order_name" />

                <ImageView
                    android:id="@+id/iv_select_address_arrow"
                    android:layout_width="@dimen/dp_30"
                    android:layout_height="0dp"
                    android:padding="@dimen/dp_8"
                    android:src="@drawable/ic_black_next_arrow"
                    app:layout_constraintBottom_toBottomOf="@id/ed_send_order_address"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@id/ed_send_order_address" />

                <View
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_1"
                    android:background="@color/color_ccc"
                    app:layout_constraintLeft_toLeftOf="@id/ed_send_order_address"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/ed_send_order_address" />

                <TextView
                    android:id="@+id/tv_send_order_distribution_mode_text"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/distribution_mode"
                    app:layout_constraintBottom_toBottomOf="@id/rg_send_order_distribution_mode"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toTopOf="@id/rg_send_order_distribution_mode" />

                <RadioGroup
                    android:id="@+id/rg_send_order_distribution_mode"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_16"
                    android:orientation="horizontal"
                    app:layout_constraintLeft_toLeftOf="@id/ed_send_order_address"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/ed_send_order_address">

                    <RadioButton
                        android:id="@+id/rb_delivery_shop"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/dp_9"
                        android:background="@drawable/s_tran_twenty_blue"
                        android:button="@null"
                        android:checked="true"
                        android:paddingLeft="@dimen/dp_13"
                        android:paddingTop="@dimen/dp_8"
                        android:paddingRight="@dimen/dp_13"
                        android:paddingBottom="@dimen/dp_8"
                        android:text="@string/delivery_shop"
                        android:textColor="@color/s_send_order_radio"
                        android:textSize="@dimen/dp_16" />

                    <RadioButton
                        android:id="@+id/rb_logistics_distribution"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="@drawable/s_tran_twenty_blue"
                        android:button="@null"
                        android:paddingLeft="@dimen/dp_13"
                        android:paddingTop="@dimen/dp_8"
                        android:paddingRight="@dimen/dp_13"
                        android:paddingBottom="@dimen/dp_8"
                        android:text="@string/logistics_distribution"
                        android:textColor="@color/s_send_order_radio"
                        android:textSize="@dimen/dp_16"
                        android:visibility="gone" />
                </RadioGroup>

                <TextView
                    android:id="@+id/tv_send_order_pay_mode_text"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/pay_mode"
                    app:layout_constraintBottom_toBottomOf="@id/rg_send_order_pay_mode"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toTopOf="@id/rg_send_order_pay_mode" />

                <RadioGroup
                    android:id="@+id/rg_send_order_pay_mode"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="@dimen/dp_10"
                    android:orientation="horizontal"
                    app:layout_constraintLeft_toLeftOf="@id/rg_send_order_distribution_mode"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/rg_send_order_distribution_mode">

                    <RadioButton
                        android:id="@+id/rb_new_order_cash_on_delivery"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginRight="@dimen/dp_9"
                        android:background="@drawable/s_tran_twenty_blue"
                        android:button="@null"
                        android:checked="true"
                        android:paddingLeft="@dimen/dp_13"
                        android:paddingTop="@dimen/dp_8"
                        android:paddingRight="@dimen/dp_13"
                        android:paddingBottom="@dimen/dp_8"
                        android:text="貨到付款"
                        android:textColor="@color/s_send_order_radio"
                        android:textSize="@dimen/dp_16" />

                    <RadioButton
                        android:id="@+id/rb_new_order_immediately_pay"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:background="@drawable/s_tran_twenty_blue"
                        android:button="@null"
                        android:paddingLeft="@dimen/dp_13"
                        android:paddingTop="@dimen/dp_8"
                        android:paddingRight="@dimen/dp_13"
                        android:paddingBottom="@dimen/dp_8"
                        android:text="立即支付"
                        android:textColor="@color/s_send_order_radio"
                        android:textSize="@dimen/dp_16"
                        android:visibility="gone" />
                </RadioGroup>

                <TextView
                    android:id="@+id/tv_send_order_delivery_time_text"
                    style="@style/otherOrderSendOrder_textStyle"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/delivery_time"
                    app:layout_constraintBottom_toBottomOf="@id/tv_delivery_time_type"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toTopOf="@id/tv_delivery_time_type" />

                <TextView
                    android:id="@+id/tv_delivery_time_type"
                    android:layout_width="67dp"
                    android:layout_height="25dp"
                    android:layout_marginLeft="@dimen/dp_5"
                    android:layout_marginTop="@dimen/dp_16"
                    android:layout_weight="1"
                    android:gravity="right"
                    android:paddingLeft="@dimen/dp_5"
                    android:text="現在送出"
                    android:textColor="@color/color_c9"
                    app:layout_constraintLeft_toRightOf="@id/tv_send_order_delivery_time_text"
                    app:layout_constraintTop_toBottomOf="@id/rg_send_order_pay_mode" />

                <ImageView
                    android:id="@+id/iv_select_delivery_time"
                    android:layout_width="@dimen/dp_20"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/dp_5"
                    android:src="@drawable/arrow_down_black"
                    app:layout_constraintBottom_toBottomOf="@id/tv_delivery_time_type"
                    app:layout_constraintLeft_toRightOf="@id/tv_delivery_time_type"
                    app:layout_constraintTop_toTopOf="@id/tv_delivery_time_type" />

                <View
                    android:id="@+id/view_delivery_time_mode_line"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_1"
                    android:layout_marginTop="@dimen/dp_10"
                    android:background="@color/color_ccc"
                    app:layout_constraintLeft_toLeftOf="@id/tv_delivery_time_type"
                    app:layout_constraintRight_toRightOf="@id/iv_select_delivery_time"
                    app:layout_constraintTop_toBottomOf="@id/tv_delivery_time_type" />

                <androidx.constraintlayout.widget.Group
                    android:id="@+id/group_time"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:visibility="gone"
                    app:constraint_referenced_ids="view_delivery_time_line,tv_delivery_time_min,tv_delivery_time_colon,tv_delivery_time_hour" />

                <TextView
                    android:id="@+id/tv_delivery_time_hour"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/dp_10"
                    android:layout_weight="1"
                    android:gravity="right"
                    android:text="00"
                    android:textColor="@color/color_c9"
                    app:layout_constraintBottom_toBottomOf="@id/tv_delivery_time_type"
                    app:layout_constraintLeft_toRightOf="@id/iv_select_delivery_time"
                    app:layout_constraintRight_toLeftOf="@id/tv_delivery_time_colon"
                    app:layout_constraintTop_toTopOf="@id/tv_delivery_time_type" />

                <TextView
                    android:id="@+id/tv_delivery_time_colon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/dp_15"
                    android:layout_marginRight="@dimen/dp_15"
                    android:layout_weight="1"
                    android:gravity="right"
                    android:paddingLeft="@dimen/dp_5"
                    android:text=":"
                    android:textColor="@color/color_c9"
                    app:layout_constraintBottom_toBottomOf="@id/tv_delivery_time_type"
                    app:layout_constraintLeft_toRightOf="@id/tv_delivery_time_hour"
                    app:layout_constraintRight_toLeftOf="@id/tv_delivery_time_min"
                    app:layout_constraintTop_toTopOf="@id/tv_delivery_time_type" />

                <TextView
                    android:id="@+id/tv_delivery_time_min"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="@dimen/dp_5"
                    android:layout_marginRight="@dimen/dp_2"
                    android:layout_weight="1"
                    android:gravity="left"
                    android:paddingLeft="@dimen/dp_5"
                    android:text="00"
                    android:textColor="@color/color_c9"
                    app:layout_constraintBottom_toBottomOf="@id/tv_delivery_time_type"
                    app:layout_constraintLeft_toRightOf="@id/tv_delivery_time_colon"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@id/tv_delivery_time_type" />

                <View
                    android:id="@+id/view_delivery_time_line"
                    android:layout_width="0dp"
                    android:layout_height="@dimen/dp_1"
                    android:background="@color/color_ccc"
                    app:layout_constraintBottom_toBottomOf="@id/view_delivery_time_mode_line"
                    app:layout_constraintLeft_toLeftOf="@id/tv_delivery_time_hour"
                    app:layout_constraintRight_toRightOf="@id/tv_delivery_time_min"
                    app:layout_constraintTop_toTopOf="@id/view_delivery_time_mode_line" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </RelativeLayout>
    </androidx.core.widget.NestedScrollView>

    <LinearLayout
        android:id="@+id/layout_btn"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/tv_continue_add_food"
            android:layout_width="0dp"
            android:layout_height="@dimen/button_height"
            android:layout_marginLeft="@dimen/dp_10"
            android:layout_marginRight="@dimen/dp_5"
            android:layout_marginBottom="@dimen/dp_10"
            android:layout_weight="1"
            android:background="@drawable/shape_app_btn"
            android:gravity="center"
            android:text="繼續點餐"
            android:textColor="@color/white"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toLeftOf="@id/tv_confirm_order" />

        <TextView
            android:id="@+id/tv_confirm_order"
            android:layout_width="0dp"
            android:layout_height="@dimen/button_height"
            android:layout_marginLeft="@dimen/dp_5"
            android:layout_marginRight="@dimen/dp_10"
            android:layout_marginBottom="@dimen/dp_10"
            android:layout_weight="1"
            android:background="@drawable/shape_app_btn"
            android:gravity="center"
            android:text="確認訂單"
            android:textColor="@color/white"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintLeft_toRightOf="@id/tv_continue_add_food"
            app:layout_constraintRight_toRightOf="parent" />
    </LinearLayout>
</RelativeLayout>
