Row Layout Recyclerview item xml example

horizontal_item_booking.xml:-

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

    <corners android:radius="50dp"/>
    <solid android:color="@color/white" />
    <stroke android:color="@color/white" android:width="1dp"/>
</shape>


<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_marginLeft="@dimen/_10mdp"
    android:layout_marginRight="@dimen/_10mdp"

    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto">


    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"

        android:layout_margin="@dimen/_5mdp"
        android:background="@drawable/rounded_box_white"
        app:cardCornerRadius="5dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:strokeWidth="1dp">

    <LinearLayout
        android:id="@+id/linearLayout4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="@dimen/_8mdp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/product_iamge"
            android:layout_width="@dimen/_60mdp"
            android:layout_height="@dimen/_60mdp"
            android:layout_marginTop="@dimen/_5mdp"
            android:background="@drawable/sevice_icon"
            android:padding="@dimen/_8mdp"
            android:scaleType="centerCrop"
            android:src="@drawable/img2" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/constraint"
            android:layout_width="match_parent"
            android:layout_height="113dp"
            android:paddingStart="@dimen/_8mdp"
            android:paddingBottom="@dimen/_3mdp">


            <TextView
                android:id="@+id/product_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_7mdp"
                android:text="Wash"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/product_desc"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:text="Timeslot:"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toStartOf="@+id/product_price"
                app:layout_constraintTop_toBottomOf="@+id/product_price" />

            <TextView
                android:id="@+id/product_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_4mdp"

                android:textColor="@color/black"
                android:text="Service Name"

                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/product_title" />


            <TextView
                android:id="@+id/textView18"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginTop="6dp"
                android:layout_marginBottom="8dp"

                android:text=""
                app:layout_constraintBottom_toTopOf="@+id/view1"
                app:layout_constraintStart_toEndOf="@+id/product_price"
                app:layout_constraintTop_toBottomOf="@+id/product_title" />


            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/shop_btn"
                android:layout_width="@dimen/_50mdp"
                android:layout_height="@dimen/_20mdp"
                android:layout_marginEnd="@dimen/_12mdp"
                android:background="#FFFFFF"
                android:text="8 kwd"
                android:textAllCaps="false"
                android:textColor="@color/black"
                android:textSize="@dimen/_10mdp"
                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="@+id/product_title" />

            <TextView
                android:id="@+id/textView26"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginTop="5dp"
                android:text="10:00am-11:00am"

                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toEndOf="@+id/product_desc"
                app:layout_constraintTop_toBottomOf="@+id/textView18" />

            <TextView
                android:id="@+id/textView30"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="5dp"
                android:text="Status    :"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                app:layout_constraintBottom_toBottomOf="@+id/order_status"
                app:layout_constraintStart_toStartOf="@+id/product_desc"
                app:layout_constraintTop_toBottomOf="@+id/product_desc" />

            <TextView
                android:id="@+id/order_status"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginTop="5dp"
                android:text="Pending"
                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toEndOf="@+id/textView30"
                app:layout_constraintTop_toBottomOf="@+id/product_desc" />


        </androidx.constraintlayout.widget.ConstraintLayout>


    </LinearLayout>

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


</androidx.constraintlayout.widget.ConstraintLayout>

Layout with Rating bar :-

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:background="?attr/selectableItemBackground"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:id="@+id/linearLayout4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="@dimen/_8mdp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/productimage"
            android:layout_width="@dimen/_60mdp"
            android:layout_height="@dimen/_60mdp"
            android:layout_marginTop="@dimen/_5mdp"


            android:src="@drawable/img2" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/constraint"
            android:layout_width="match_parent"
            android:layout_height="122dp"
            android:paddingStart="@dimen/_8mdp"
            android:paddingBottom="@dimen/_3mdp">


            <TextView
                android:id="@+id/product_title"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_7mdp"
                android:singleLine="false"
                android:text="Wooden Chair"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/product_desc"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_4mdp"
                android:text="Thsi Chair is good for house"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toStartOf="@+id/product_price"
                app:layout_constraintTop_toBottomOf="@+id/product_price" />


            <TextView
                android:id="@+id/product_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_4mdp"
                android:drawableLeft="@drawable/rupees_icon"
                android:drawablePadding="@dimen/_1mdp"
                android:text="200"
                android:textColor="#E91E63"
                android:textSize="@dimen/_11mdp"
                android:visibility="gone"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/product_title" />

            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/shop_btn"
                android:layout_width="@dimen/_21mdp"
                android:layout_height="@dimen/_21mdp"
                android:layout_marginEnd="@dimen/_12mdp"
                android:background="@drawable/right_arrow"


                android:textAllCaps="false"
                android:textColor="@color/white"
                android:textSize="@dimen/_10mdp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="@+id/product_title" />

            <RatingBar
                android:id="@+id/ratingBar4"
                style="@android:attr/ratingBarStyleSmall"
                android:layout_width="243dp"
                android:layout_height="45dp"
                android:layout_marginTop="20dp"
                android:layout_marginEnd="100dp"
                android:numStars="5"
                android:scaleX="0.5"
                android:scaleY="0.5"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="1.0"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/product_title" />

            <TextView
                android:id="@+id/textView16"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginBottom="3dp"
                android:text="Rate this product now"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/ratingBar4"
                tools:layout_editor_absoluteX="11dp" />


        </androidx.constraintlayout.widget.ConstraintLayout>


    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#16000000"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/linearLayout4" />


</androidx.constraintlayout.widget.ConstraintLayout>

Order Single item :-

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:background="?attr/selectableItemBackground"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:id="@+id/linearLayout4"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:padding="@dimen/_8mdp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/productimage"
            android:layout_width="@dimen/_60mdp"
            android:layout_height="@dimen/_60mdp"
            android:layout_marginTop="@dimen/_5mdp"
            android:scaleType="centerCrop"
            android:src="@drawable/img2" />

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/constraint"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingStart="@dimen/_8mdp"
            android:paddingBottom="@dimen/_3mdp">


            <TextView
                android:id="@+id/product_title"
                android:layout_width="200dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_7mdp"
                android:singleLine="false"
                android:text="Wooden Chair"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/product_desc"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_4mdp"
                android:text="Thsi Chair is good for house"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                app:layout_constraintStart_toStartOf="@+id/product_price"
                app:layout_constraintTop_toBottomOf="@+id/product_price" />


            <TextView
                android:id="@+id/product_price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_4mdp"
                android:text="200"
                android:textColor="#E91E63"
                android:visibility="gone"
                android:drawablePadding="@dimen/_1mdp"
                android:drawableLeft="@drawable/rupees_icon"
                android:textSize="@dimen/_11mdp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/product_title" />

            <androidx.appcompat.widget.AppCompatButton
                android:id="@+id/shop_btn"
                android:layout_width="@dimen/_50mdp"
                android:layout_height="@dimen/_20mdp"
                android:layout_marginEnd="@dimen/_12mdp"
                android:background="#3EB0E0"
                android:text=" Buy Again "
                android:textAllCaps="false"
                android:textColor="@color/white"
                android:textSize="@dimen/_10mdp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="@+id/product_title" />


        </androidx.constraintlayout.widget.ConstraintLayout>


    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="#16000000"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/linearLayout4" />


</androidx.constraintlayout.widget.ConstraintLayout>

Show product in grid layout :-

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_5mdp"
        android:background="@drawable/rounded_box"
        app:cardCornerRadius="5dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:strokeWidth="1dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/_10mdp"
            android:background="?android:attr/selectableItemBackground"
            android:padding="0dp"
            android:textAlignment="center">

            <ImageView
                android:id="@+id/product_image"
                android:layout_width="match_parent"
                android:layout_height="@dimen/_130mdp"
                android:layout_marginLeft="@dimen/_8mdp"
                android:layout_marginTop="@dimen/_10mdp"
                android:layout_marginRight="@dimen/_8mdp"

                android:src="@drawable/s1"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/category_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_6mdp"
                android:layout_marginTop="@dimen/_5mdp"
                android:layout_marginEnd="@dimen/_6mdp"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:text="Name of Book"
                android:textColor="@color/black"
                android:textSize="@dimen/_13mdp"

                app:layout_constraintEnd_toEndOf="@+id/product_image"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="@+id/product_image"
                app:layout_constraintTop_toBottomOf="@+id/product_image" />


            <TextView
                android:id="@+id/txt_productprice"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12mdp"
                android:layout_marginTop="@dimen/_2mdp"
                android:layout_marginEnd="@dimen/_6mdp"
                android:drawableLeft="@drawable/rupeebold"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:text="Name of Book"
                android:textColor="@color/black"
                android:textSize="@dimen/_14mdp"
                android:textStyle="bold"
                app:layout_constraintEnd_toEndOf="@+id/category_name"
                app:layout_constraintStart_toStartOf="@+id/category_name"


                app:layout_constraintTop_toBottomOf="@+id/category_name" />

            <TextView
                android:id="@+id/txt_rating"
                android:layout_width="65dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_2mdp"
                android:layout_marginTop="@dimen/_2mdp"

                android:background="@drawable/rounded_rating"
                android:drawableRight="@drawable/pointedstar"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:paddingLeft="10dp"
                android:paddingRight="5dp"
                android:paddingBottom="2dp"
                android:text="4.5"

                android:textColor="@color/white"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"


                app:drawableTint="@color/white"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="@+id/txt_productprice"
                app:layout_constraintTop_toBottomOf="@+id/txt_productprice" />

            <ImageView
                android:id="@+id/wishlisticon"
                android:layout_width="32dp"
                android:layout_height="32dp"
                android:layout_marginEnd="4dp"
                android:tint="@color/grey_color"
                app:layout_constraintBottom_toBottomOf="@+id/product_image"
                app:layout_constraintEnd_toEndOf="@+id/product_image"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_bias="0.086"
                app:srcCompat="@drawable/deletebig" />

        </androidx.constraintlayout.widget.ConstraintLayout>

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

</androidx.constraintlayout.widget.ConstraintLayout>

Review item design:-


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

    <corners android:radius="5dp"/>
    <solid android:color="@color/green"/>
    <stroke android:color="@color/green" android:width="1dp"/>
</shape>


<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_5mdp"
        android:background="@drawable/rounded_box"
        app:cardCornerRadius="5dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:strokeWidth="1dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="@dimen/_10mdp"
            android:background="?android:attr/selectableItemBackground"
            android:padding="0dp"
            android:layout_marginLeft="15dp"
            android:textAlignment="center"

            >

            <ImageView
                android:id="@+id/product_image"
                android:layout_width="match_parent"
                android:layout_height="@dimen/_130mdp"
                android:layout_marginLeft="@dimen/_8mdp"
                android:layout_marginTop="@dimen/_10mdp"
                android:layout_marginRight="@dimen/_8mdp"
                android:src="@drawable/s1"

                android:visibility="gone"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />


            <TextView
                android:id="@+id/ratingValue"
                android:layout_width="55dp"
                android:layout_height="wrap_content"

                android:layout_marginTop="16dp"
                android:background="@drawable/rounded_rating"
                android:drawableRight="@drawable/pointedstar"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:paddingLeft="10dp"

                android:paddingRight="5dp"
                android:paddingBottom="2dp"
                android:text="4.5"


                android:textColor="@color/white"


                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"
                app:drawableTint="@color/white"
                app:layout_constraintTop_toTopOf="parent"
                tools:layout_editor_absoluteX="34dp" />

            <TextView
                android:id="@+id/txtUsercomment"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"

                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:text="Name of Book"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"


                app:layout_constraintEnd_toEndOf="@+id/ratingValue"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="@+id/ratingValue"
                app:layout_constraintTop_toBottomOf="@+id/ratingValue" />

            <TextView
                android:id="@+id/txtUsername"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"

                android:text="Name of Book"



                android:textSize="@dimen/_11mdp"
                app:layout_constraintStart_toStartOf="@+id/txtUsercomment"
                app:layout_constraintTop_toBottomOf="@+id/txtUsercomment" />

            <ImageView
                android:id="@+id/wishlisticon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="4dp"
                android:tint="@color/grey_color"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="@+id/product_image"
                app:layout_constraintEnd_toEndOf="@+id/product_image"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_bias="0.086"
                app:srcCompat="@drawable/wishbig" />

            <TextView
                android:id="@+id/txtCommenttime"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="TextView"
                app:layout_constraintEnd_toEndOf="@+id/txtUsername"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="@+id/txtUsername"
                app:layout_constraintTop_toBottomOf="@+id/txtUsername" />

        </androidx.constraintlayout.widget.ConstraintLayout>

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



</androidx.constraintlayout.widget.ConstraintLayout>

Grid_list_item:-

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_5mdp"
        android:background="@drawable/rounded_box"
        app:cardCornerRadius="5dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:strokeWidth="1dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/_10mdp"
            android:background="?android:attr/selectableItemBackground"
            android:padding="0dp"
            android:textAlignment="center">

            <ImageView
                android:id="@+id/product_image"
                android:layout_width="match_parent"
                android:layout_height="@dimen/_130mdp"
                android:layout_marginLeft="@dimen/_8mdp"
                android:layout_marginTop="@dimen/_1mdp"
                android:layout_marginRight="@dimen/_8mdp"

                android:src="@drawable/s1"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/category_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_6mdp"
                android:layout_marginTop="@dimen/_5mdp"
                android:layout_marginEnd="@dimen/_6mdp"
                android:ellipsize="end"
                android:gravity="center_horizontal"
                android:maxLines="1"
                android:text="Name of Book"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"
                app:layout_constraintEnd_toEndOf="@+id/product_image"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="@+id/product_image"
                app:layout_constraintTop_toBottomOf="@+id/product_image" />

        </androidx.constraintlayout.widget.ConstraintLayout>

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

</androidx.constraintlayout.widget.ConstraintLayout>

grid_list item for product :-


rounded_box
<color name="light_grey">#E8E8E8</color>


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

    <corners android:radius="5dp"/>
    <solid android:color="@color/light_grey" />
    <stroke android:color="@color/light_grey" android:width="1dp"/>
</shape>

round_rating:-

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

    <corners android:radius="5dp"/>
    <solid android:color="@color/green"/>
    <stroke android:color="@color/green" android:width="1dp"/>
</shape>

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

    <corners android:topLeftRadius="2dp"  android:bottomLeftRadius="2dp"/>
    <solid android:color="@color/green"/>
    <stroke android:color="@color/green" android:width="1dp"/>
</shape>

rounded_right :-
 <color name="green">#269E2B</color>


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

    <corners android:topRightRadius="2dp"  android:bottomRightRadius="2dp"/>
    <solid android:color="@color/green"/>
    <stroke android:color="@color/green" android:width="1dp"/>
</shape>



<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <com.google.android.material.card.MaterialCardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_5mdp"
        android:background="@drawable/rounded_box"
        app:cardCornerRadius="5dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:strokeWidth="1dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/_10mdp"
            android:background="?android:attr/selectableItemBackground"
            android:padding="0dp"
            android:textAlignment="center">

            <ImageView
                android:id="@+id/product_image"
                android:layout_width="match_parent"
                android:layout_height="@dimen/_130mdp"
                android:layout_marginLeft="@dimen/_8mdp"
                android:layout_marginTop="@dimen/_10mdp"
                android:layout_marginRight="@dimen/_8mdp"


                android:src="@drawable/s1"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/category_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_5mdp"
                android:layout_marginEnd="@dimen/_6mdp"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:text="Name of Book"
                android:textColor="@color/black"
                android:textSize="@dimen/_13mdp"

                app:layout_constraintEnd_toEndOf="@+id/product_image"
                app:layout_constraintHorizontal_bias="0.0"
                app:layout_constraintStart_toStartOf="@+id/product_image"
                app:layout_constraintTop_toBottomOf="@+id/product_image" />


            <TextView
                android:id="@+id/txt_productprice"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="@dimen/_2mdp"
                android:drawableLeft="@drawable/rupeebold"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:layout_marginRight="2dp"
                android:text="Name of Book"
                android:textColor="@color/black"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="@+id/category_name"


                app:layout_constraintTop_toBottomOf="@+id/category_name" />

            <TextView
                android:id="@+id/txt_rating"
                android:layout_width="65dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_2mdp"
                android:layout_marginTop="@dimen/_2mdp"

                android:background="@drawable/rounded_rating"
                android:drawableRight="@drawable/pointedstar"
                android:ellipsize="end"
                android:gravity="left"
                android:maxLines="1"
                android:paddingLeft="10dp"
                android:paddingRight="5dp"
                android:paddingBottom="2dp"
                android:text="4.5"

                android:textColor="@color/white"
                android:textSize="@dimen/_12mdp"
                android:textStyle="bold"


                app:drawableTint="@color/white"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintStart_toStartOf="@+id/txt_productprice"
                app:layout_constraintTop_toBottomOf="@+id/txt_productprice" />

            <ImageView
                android:id="@+id/wishlisticon"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="4dp"
                android:tint="@color/grey_color"
                app:layout_constraintBottom_toBottomOf="@+id/product_image"
                app:layout_constraintEnd_toEndOf="@+id/product_image"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_bias="0.086"
                app:srcCompat="@drawable/wishbig" />

            <TextView
                android:id="@+id/textView18"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginTop="4dp"
                android:text="100"
                app:layout_constraintStart_toEndOf="@+id/txt_productprice"
                app:layout_constraintTop_toBottomOf="@+id/category_name" />

            <TextView
                android:id="@+id/textView19"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text="10"
                android:paddingLeft="2dp"
                android:layout_marginLeft="5dp"
                android:background="@drawable/rounded_disc"
                android:textColor="@color/white"
                app:layout_constraintStart_toEndOf="@+id/textView18"
                app:layout_constraintTop_toBottomOf="@+id/category_name" />

            <TextView
                android:id="@+id/textView25"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="4dp"
                android:text="%off"
              android:paddingRight="2dp"
                android:textColor="@color/white"
                android:background="@drawable/rounded_right"
                app:layout_constraintStart_toEndOf="@+id/textView19"
                app:layout_constraintTop_toBottomOf="@+id/category_name" />

        </androidx.constraintlayout.widget.ConstraintLayout>

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

</androidx.constraintlayout.widget.ConstraintLayout>

item for horizontal scrolling :-

for circle background:
   <color name="grey_color">#2A949494</color>

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

    <solid android:color="@color/grey_color"/>


</shape>



<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <LinearLayout
        android:layout_width="80dp"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/_4mdp"
        android:gravity="center"
        android:orientation="vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ImageView
            android:id="@+id/productimage"
            android:layout_width="@dimen/_60mdp"
            android:layout_height="@dimen/_60mdp"
            android:background="@drawable/circle_background"
            android:padding="@dimen/_13mdp"
            android:src="@drawable/img2" />

        <TextView
            android:id="@+id/product_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:singleLine="false"
            android:text="Hardwahfduegfheghufehvfehbvfhebvre"
            android:textColor="@color/black"
            android:textSize="@dimen/_10mdp"
            android:textStyle="bold" />

    </LinearLayout>

</androidx.constraintlayout.widget.ConstraintLayout>