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

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

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

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

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

        <variable
            name="delivery_difference"
            type="String" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/bar_delivery"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:barrierDirection="right"
            app:constraint_referenced_ids="tv_difference_text,tv_delivery_method_text,tv_delivery_fee_text,tv_delivery_type_text,tv_delivery_expenses_text" />

        <TextView
            android:id="@+id/tv_delivery_type_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/dp_10"
            android:layout_marginTop="@dimen/dp_10"
            android:text="@string/delivery_type"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_14"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <TextView
            android:id="@+id/tv_delivery_type"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="left"
            android:text="@{delivery_type}"
            app:layout_constraintLeft_toRightOf="@id/bar_delivery"
            app:layout_constraintRight_toLeftOf="@id/iv_edit"
            app:layout_constraintTop_toTopOf="@id/tv_delivery_type_text" />


        <TextView
            android:id="@+id/tv_delivery_expenses_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/dp_5"
            android:text="@string/delivery_expenses"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_14"
            app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type_text"
            app:layout_constraintTop_toBottomOf="@id/tv_delivery_type_text" />


        <TextView
            android:id="@+id/tv_delivery_expenses"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="left"
            android:text="@{delivery_expenses}"
            app:layout_constraintLeft_toRightOf="@id/bar_delivery"
            app:layout_constraintRight_toLeftOf="@id/iv_edit"
            app:layout_constraintTop_toTopOf="@id/tv_delivery_expenses_text" />

        <TextView
            android:id="@+id/tv_delivery_fee_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/dp_5"
            android:text="@string/delivery_fee"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_14"
            app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type_text"
            app:layout_constraintTop_toBottomOf="@id/tv_delivery_expenses_text" />

        <TextView
            android:id="@+id/tv_delivery_fee"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="left"
            android:text="@{delivery_fee}"
            app:layout_constraintLeft_toRightOf="@id/bar_delivery"
            app:layout_constraintRight_toLeftOf="@id/iv_edit"
            app:layout_constraintTop_toTopOf="@id/tv_delivery_fee_text" />

        <TextView
            android:id="@+id/tv_delivery_method_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/dp_5"
            android:text="@string/delivery_method"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_14"
            app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type_text"
            app:layout_constraintTop_toBottomOf="@id/tv_delivery_fee_text" />

        <TextView
            android:id="@+id/tv_delivery_method"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="left"
            android:text="@{delivery_method}"
            app:layout_constraintLeft_toRightOf="@id/bar_delivery"
            app:layout_constraintRight_toLeftOf="@id/iv_edit"
            app:layout_constraintTop_toTopOf="@id/tv_delivery_method_text" />

        <TextView
            android:id="@+id/tv_difference_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/dp_5"
            android:text="@string/delivery_difference"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_14"
            android:visibility="gone"
            app:layout_constraintLeft_toLeftOf="@id/tv_delivery_type_text"
            app:layout_constraintTop_toBottomOf="@id/tv_delivery_method_text" />

        <TextView
            android:id="@+id/tv_difference"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="left"
            android:text="@{delivery_difference}"
            android:visibility="gone"
            app:layout_constraintLeft_toRightOf="@id/bar_delivery"
            app:layout_constraintRight_toLeftOf="@id/iv_edit"
            app:layout_constraintTop_toTopOf="@id/tv_difference_text" />

        <ImageView
            android:id="@+id/iv_edit"
            android:layout_width="@dimen/dp_30"
            android:layout_height="0dp"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="center"
            android:paddingLeft="@dimen/dp_5"
            android:paddingRight="@dimen/dp_5"
            android:src="@drawable/ic_edit"
            android:text="編輯"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_12"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintRight_toLeftOf="@id/iv_delete"
            app:layout_constraintTop_toTopOf="parent" />

        <com.qmuiteam.qmui.alpha.QMUIAlphaImageButton
            android:id="@+id/iv_delete"
            android:layout_width="@dimen/dp_30"
            android:layout_height="0dp"
            android:layout_marginRight="@dimen/dp_10"
            android:gravity="center"
            android:paddingLeft="@dimen/dp_5"
            android:paddingRight="@dimen/dp_5"
            android:src="@drawable/ic_delete"
            android:text="刪除"
            android:textColor="@color/theme_333_color"
            android:textSize="@dimen/dp_12"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/horizontal_dividing_line"
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp_0_5"
            android:layout_marginTop="@dimen/dp_10"
            android:background="@color/color_ccc"
            app:layout_constraintTop_toBottomOf="@id/tv_difference_text" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>