<!--
  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.diagnose.DiagnoseSyncFragment">

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

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

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

        <FrameLayout
            android:layout_weight="1"
            android:layout_width="match_parent"
            android:layout_height="0dp">

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

            <TextView
                android:text="@string/diagnose_sync_empty"
                android:layout_margin="16dp"
                android:gravity="center"
                android:textAppearance="?android:textAppearanceMedium"
                android:visibility="@{safeUnbox(isListEmpty) ? View.VISIBLE : View.GONE}"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </FrameLayout>

        <Button
            android:id="@+id/clear_cache_btn"
            android:text="@string/diagnose_sync_btn_clear_cache"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

        <Button
            android:id="@+id/request_sync_btn"
            android:text="@string/diagnose_sync_btn_request_sync"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </LinearLayout>
</layout>
