<?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="android.view.View" />

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

        <variable
            name="price"
            type="Float" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="@dimen/dp_12">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/layout_food_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintHorizontal_weight="0.5"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toLeftOf="@id/tv_food_number"
            app:layout_constraintTop_toTopOf="parent">

            <ImageView
                android:id="@+id/iv_food_item_next"
                android:layout_width="wrap_content"
                android:layout_height="0dp"
                android:src="@drawable/item_next"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="@id/tv_food_name"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="@id/tv_food_name" />

            <TextView
                android:id="@+id/tv_food_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:text="@{data.pRODUCT_NAME}"
                android:textColor="@color/color_3c"
                android:textSize="@dimen/dp_15"
                app:layout_constraintLeft_toRightOf="@id/iv_food_item_next"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <TextView
            android:id="@+id/tv_food_number"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:text="@{@string/count + data.num}"
            android:textColor="@color/color_3c"
            android:textSize="@dimen/dp_15"
            android:gravity="right"
            app:layout_constraintHorizontal_weight="0.2"
            app:layout_constraintLeft_toRightOf="@id/layout_food_name"
            app:layout_constraintRight_toLeftOf="@id/tv_food_price"
            app:layout_constraintTop_toTopOf="@id/layout_food_name" />

        <TextView
            android:id="@+id/tv_food_price"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:gravity="right"
            android:text="@{@string/amount_unit + data.pRICE}"
            android:textColor="@color/color_3c"
            android:textSize="@dimen/dp_15"
            android:visibility="@{price > 0 ? View.VISIBLE : View.INVISIBLE}"
            app:layout_constraintHorizontal_weight="0.3"
            app:layout_constraintLeft_toRightOf="@id/tv_food_number"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="@id/layout_food_name" />

        <LinearLayout
            android:id="@+id/layout_food_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_constraintTop_toBottomOf="@id/layout_food_name" />


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