<?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="products"
            type="com.yono.messeripos.models.ProductModels" />

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

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

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

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginHorizontal="5dp"
        android:layout_marginVertical="10dp">

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/cvProduct"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardElevation="0dp"
            app:strokeWidth="1dp"
            app:strokeColor="#3CB3B3B3"
            app:cardCornerRadius="10dp">

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

                <ImageView
                    android:id="@+id/image_product"
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:src="@mipmap/ic_meser_icon"
                    app:layout_constraintTop_toTopOf="parent"
                    app:url="@{image}"
                    android:scaleType="fitXY"/>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/btnDelete"
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:layout_margin="10dp"
                    android:backgroundTint="@color/colorRed"
                    android:text="Delete"
                    app:layout_constraintBottom_toBottomOf="@id/image_product"
                    app:layout_constraintEnd_toEndOf="parent" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/btnEdit"
                    android:layout_width="wrap_content"
                    android:layout_height="40dp"
                    android:layout_marginEnd="10dp"
                    app:layout_constraintBottom_toTopOf="@id/btnDelete"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:backgroundTint="@color/colorGreen"
                    android:text="UPDATE"/>

                <TextView
                    android:id="@+id/title_product"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toBottomOf="@id/image_product"
                    app:layout_constraintStart_toStartOf="parent"
                    tools:text="@tools:sample/full_names"
                    android:textColor="@android:color/black"
                    android:layout_marginStart="10dp"
                    android:layout_marginTop="5dp"
                    android:textSize="18sp"
                    android:lines="1"
                    android:textStyle="bold"
                    android:text="@{products.productName}"
                    android:maxLength="25"/>

                <TextView
                    android:id="@+id/price"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintTop_toBottomOf="@id/title_product"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintBottom_toTopOf="@id/materialBtnAddCart"
                    tools:text="@tools:sample/full_names"
                    android:textColor="#5E101010"
                    android:layout_marginStart="10dp"
                    android:layout_marginTop="5dp"
                    android:textSize="18sp"
                    android:lines="1"
                    android:text="@{price}"
                    android:maxLength="25"/>

                <TextView
                    android:id="@+id/status"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:layout_constraintBottom_toBottomOf="@id/price"
                    app:layout_constraintTop_toTopOf="@id/price"
                    app:layout_constraintStart_toEndOf="@id/price"
                    tools:text="@tools:sample/full_names"
                    android:textColor="@android:color/black"
                    android:layout_marginStart="10dp"
                    android:textSize="10sp"
                    android:lines="1"
                    android:textAllCaps="true"
                    android:text="@{status}"
                    android:maxLength="25"/>

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/materialBtnAddCart"
                    android:padding="1dp"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="bottom"
                    android:layout_marginStart="10dp"
                    android:layout_marginEnd="10dp"
                    android:text="Add To Cart"
                    app:layout_constraintTop_toBottomOf="@id/price"
                    app:layout_constraintBottom_toBottomOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout>


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

    </androidx.constraintlayout.widget.ConstraintLayout>

</layout>