<?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="mainView"
            type="com.yono.messeripos.models.MainViewModels" />
    </data>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/topBar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:paddingTop="20dp">

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/topAppBar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@color/colorPrimary"
                app:menu="@menu/home"
                android:elevation="0dp"
                app:navigationIcon="@drawable/logo_32"
                style="@style/Widget.MaterialComponents.Toolbar.Primary"
                >

                <EditText
                    android:id="@+id/etSearchProduct"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="#fff"
                    android:hint="Search"
                    android:paddingStart="10dp"
                    android:textColorHint="#fff"
                    android:outlineSpotShadowColor="#fff"
                    android:textColorHighlight="#fff"
                    android:drawableStart="@drawable/ic_baseline_search_24"/>

            </com.google.android.material.appbar.MaterialToolbar>

        </com.google.android.material.appbar.AppBarLayout>


        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rvCategory"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/topBar"
            android:layout_alignParentEnd="true"
            android:paddingTop="10dp"
            android:layout_marginEnd="0dp" />

        <ImageView
            android:id="@+id/imgEmpty"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:visibility="gone"
            android:src="@drawable/no"
            android:layout_alignParentBottom="true"
            android:layout_below="@id/rvCategory"
            />

        <ProgressBar
            android:id="@+id/pbLoading"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:backgroundTint="@color/colorAccent"
            android:indeterminateTint="@color/colorAccent"
            android:layout_centerInParent="true"/>

<!--         Scrollable content -->

        <TextView
            android:id="@+id/tvProduct"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_below="@id/rvCategory"
            android:textColor="@android:color/black"
            android:textSize="18sp"
            android:textAllCaps="true"
            android:layout_margin="5dp" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rvProduct"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:overScrollMode="never"
            app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
            app:spanCount="2"
            android:layout_marginHorizontal="5dp"
            tools:listitem="@layout/item_list"
            android:layout_below="@id/tvProduct"/>


    </RelativeLayout>
</layout>