<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/mainLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/primaryBackgroundColor"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <com.google.android.material.chip.ChipGroup
            android:id="@+id/filterChipGroup"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingStart="@dimen/dimen8dp"
            android:paddingEnd="@dimen/dimen8dp"
            app:singleSelection="true"
            app:selectionRequired="true">

            <com.google.android.material.chip.Chip
                android:id="@+id/unreadChip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/isUnread"
                style="@style/CustomChipFilter"
                app:checkedIconEnabled="true"
                android:checked="true" />

            <com.google.android.material.chip.Chip
                android:id="@+id/readChip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/isRead"
                style="@style/CustomChipFilter"
                app:checkedIconEnabled="true" />

        </com.google.android.material.chip.ChipGroup>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:background="?attr/primaryBackgroundColor"
            android:padding="@dimen/dimen8dp">

            <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
                android:id="@+id/pullToRefresh"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/notifications"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>

            </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

        </FrameLayout>

    </LinearLayout>

    <com.google.android.material.progressindicator.LinearProgressIndicator
        android:id="@+id/progressBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:indeterminate="true"
        style="@style/Widget.MaterialComponents.LinearProgressIndicator"
        app:indicatorColor="?attr/progressIndicatorColor" />

    <TextView
        android:id="@+id/noDataNotifications"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_margin="15dp"
        android:gravity="center"
        android:text="@string/noDataNotifications"
        android:textColor="?attr/primaryTextColor"
        android:textSize="20sp"
        android:visibility="gone" />

    <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
        android:id="@+id/markAllAsRead"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end|bottom"
        android:layout_margin="16dp"
        android:text="@string/markAsRead"
        android:contentDescription="@string/markAsRead"
        android:textColor="?attr/materialCardBackgroundColor"
        app:iconTint="?attr/materialCardBackgroundColor"
        android:backgroundTint="?attr/fabColor"
        app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior"
        app:icon="@drawable/ic_done" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>
