<?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"
    xmlns:tools="http://schemas.android.com/tools">

    <data>
        <variable
            name="carts"
            type="com.yono.messeripos.models.ProductCartModels" />

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

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

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

    </data>


    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="12dp">

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cvCart"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            tools:ignore="MissingConstraints">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="20dp"
                android:paddingVertical="15dp">

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/tvProductName"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/roboto"
                    android:text="@{carts.product_name_orders}"
                    android:textSize="24sp"
                    app:layout_constraintStart_toStartOf="parent"
                    tools:text="@string/hint_product_name"
                    app:layout_constraintTop_toTopOf="parent" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/tvPrice"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/roboto"
                    android:text="@{price}"
                    tools:text="@string/hint_price"
                    android:textSize="16sp"
                    app:layout_constraintStart_toStartOf="@id/tvProductName"
                    app:layout_constraintTop_toBottomOf="@+id/tvProductName" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/cross"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:fontFamily="@font/roboto"
                    android:text="x"
                    android:textSize="16sp"
                    app:layout_constraintBottom_toBottomOf="@id/tvPrice"
                    app:layout_constraintStart_toEndOf="@id/tvPrice" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/tvQuantity"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:fontFamily="@font/roboto"
                    android:text="@{carts.quantity_orders+``}"
                    android:textSize="16sp"
                    app:layout_constraintBottom_toBottomOf="@id/cross"
                    app:layout_constraintStart_toEndOf="@id/cross" />

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/tvTotal"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/roboto"
                    android:text="@{subTotal}"
                    android:textFontWeight="600"
                    android:textSize="16sp"
                    app:layout_constraintBottom_toBottomOf="@id/tvQuantity"
                    app:layout_constraintEnd_toEndOf="parent" />

                <ImageButton
                    android:id="@+id/btMinus"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:background="@drawable/ic_rounded_circle"
                    android:padding="10dp"
                    android:tint="@color/colorWhite"
                    android:src="@drawable/ic_baseline_minus_24"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/tvPrice" />


                <com.google.android.material.textfield.TextInputLayout
                    android:id="@+id/tiQty"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:boxBackgroundColor="#fff"
                    app:layout_constraintBottom_toBottomOf="@id/btMinus"
                    app:layout_constraintStart_toEndOf="@id/btMinus">

                    <com.google.android.material.textfield.TextInputEditText
                        android:id="@+id/etQty"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:enabled="false"
                        android:textColor="#333" />

                </com.google.android.material.textfield.TextInputLayout>

                <ImageButton
                    android:id="@+id/btPlus"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/ic_rounded_circle"
                    android:padding="10dp"
                    android:tint="@color/colorWhite"
                    android:src="@drawable/ic_baseline_plus_24"
                    app:layout_constraintBottom_toBottomOf="@id/tiQty"
                    app:layout_constraintStart_toEndOf="@id/tiQty" />

                <ImageButton
                    android:id="@+id/btDelete"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:backgroundTint="#00FFFFFF"
                    android:src="@drawable/ic_baseline_delete_24"
                    app:layout_constraintBottom_toBottomOf="@id/btPlus"
                    app:layout_constraintEnd_toEndOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>


        </com.google.android.material.card.MaterialCardView>

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