<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>

        <import type="com.gingersoft.gsa.cloud.base.utils.time.TimeUtils" />

        <variable
            name="data"
            type="com.gingersoft.gsa.other_order_mode.data.model.bean.OrderList.DataBeanX.DataBean" />

        <variable
            name="state"
            type="String" />

        <variable
            name="orderingMethod"
            type="String" />

        <variable
            name="payMethod"
            type="String" />

        <variable
            name="orderingMethodBg"
            type="android.graphics.drawable.Drawable" />

        <variable
            name="stateBg"
            type="android.graphics.drawable.Drawable" />

        <variable
            name="payMethodBg"
            type="android.graphics.drawable.Drawable" />

    </data>

    <com.lihang.ShadowLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="@dimen/dp_7"
        android:layout_marginTop="@dimen/dp_7"
        android:layout_marginRight="@dimen/dp_7"
        app:hl_cornerRadius="@dimen/dp_8"
        app:hl_shadowLimit="@dimen/dp_3">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="@dimen/dp_10"
            android:paddingTop="@dimen/dp_5"
            android:paddingRight="@dimen/dp_10"
            android:paddingBottom="@dimen/dp_10">

            <TextView
                android:id="@+id/tv_payment_method"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@{payMethodBg}"
                android:paddingLeft="@dimen/dp_5"
                android:paddingTop="@dimen/dp_1"
                android:paddingRight="@dimen/dp_5"
                android:paddingBottom="@dimen/dp_1"
                android:text="@{payMethod}"
                android:textColor="@color/white"
                android:textSize="@dimen/sp_14"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/tv_ordering_method"
                android:layout_width="@dimen/dp_20"
                android:layout_height="@dimen/dp_20"
                android:layout_marginLeft="@dimen/dp_8"
                android:background="@{orderingMethodBg}"
                android:gravity="center"
                android:text="@{orderingMethod}"
                android:textColor="@color/white"
                android:textSize="@dimen/sp_14"
                app:layout_constraintLeft_toRightOf="@id/tv_payment_method"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/tv_order_user_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_5"
                android:text="@{data.rECEIVER}"
                android:textColor="@color/theme_333_color"
                android:textSize="@dimen/sp_14"
                android:textStyle="bold"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@id/tv_ordering_method" />

            <TextView
                android:id="@+id/tv_order_time"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/dp_5"
                android:text="@{TimeUtils.parseTimeRepeat(data.cREATE_TIME,TimeUtils.DEFAULT_DATE_FORMAT)}"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintBottom_toBottomOf="@id/tv_order_user_name"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="@id/tv_order_user_name" />

            <androidx.constraintlayout.widget.Barrier
                android:id="@+id/barrier_order_info"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                app:barrierDirection="right"
                app:constraint_referenced_ids="tv_address_text,tv_cellphone_num_text,tv_order_num_text" />

            <TextView
                android:id="@+id/tv_cellphone_num_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/dp_5"
                android:text="手機號:"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@id/tv_order_user_name" />

            <TextView
                android:id="@+id/tv_cellphone_num"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/dp_5"
                android:text="@{data.pHONE}"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintLeft_toRightOf="@id/barrier_order_info"
                app:layout_constraintTop_toTopOf="@id/tv_cellphone_num_text" />

            <TextView
                android:id="@+id/tv_order_num_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/dp_2"
                android:layout_marginTop="@dimen/dp_5"
                android:text="訂單號:"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintLeft_toLeftOf="@id/tv_cellphone_num_text"
                app:layout_constraintTop_toBottomOf="@id/tv_cellphone_num_text" />

            <TextView
                android:id="@+id/tv_order_num"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{data.oRDER_NO}"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintLeft_toLeftOf="@id/tv_cellphone_num"
                app:layout_constraintTop_toTopOf="@id/tv_order_num_text" />


            <TextView
                android:id="@+id/tv_order_state"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@{stateBg}"
                android:padding="@dimen/dp_5"
                android:text="@{state}"
                android:textColor="@color/white"
                android:textSize="@dimen/dp_14"
                app:layout_constraintBottom_toBottomOf="@id/tv_order_num_text"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="@id/tv_cellphone_num_text" />


            <TextView
                android:id="@+id/tv_address_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/dp_2"
                android:layout_marginTop="@dimen/dp_5"
                android:text="地址:"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@id/tv_order_num_text" />

            <TextView
                android:id="@+id/tv_address"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginRight="@dimen/dp_5"
                android:text="@{data.aDDRESS_DETAIL}"
                android:textColor="@color/color_ccc"
                android:textSize="@dimen/sp_12"
                app:layout_constraintLeft_toLeftOf="@id/tv_cellphone_num"
                app:layout_constraintRight_toLeftOf="@id/tv_order_amount"
                app:layout_constraintTop_toTopOf="@id/tv_address_text" />

            <TextView
                android:id="@+id/tv_order_amount"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@{@string/amount_unit + data.pAY_AMOUNT}"
                android:textColor="@color/red_600"
                android:textSize="@dimen/sp_14"
                app:layout_constraintBottom_toBottomOf="@id/tv_address"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="@id/tv_address" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </com.lihang.ShadowLayout>
</layout>