<!--
  TimeLimit Copyright <C> 2019 Jonas Lochmann
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation version 3 of the License.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="io.timelimit.android.ui.manage.category.usagehistory.UsageHistoryFragment">

    <data>
        <variable
            name="isEmpty"
            type="Boolean" />

        <import type="android.view.View" />
    </data>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

        <RelativeLayout
            android:visibility="@{safeUnbox(isEmpty) ? View.VISIBLE : View.GONE}"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <LinearLayout
                android:padding="16dp"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:textAppearance="?android:textAppearanceLarge"
                    android:gravity="center_horizontal"
                    android:text="@string/usage_history_empty_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

                <TextView
                    android:textAppearance="?android:textAppearanceMedium"
                    android:gravity="center_horizontal"
                    android:text="@string/usage_history_empty_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content" />

            </LinearLayout>

        </RelativeLayout>

    </FrameLayout>
</layout>
