<?xml version="1.0" encoding="utf-8"?>
<!--
    Nextcloud Android client application

    @author Chris Narkiewicz
    Copyright (C) 2019 Chris Narkiewicz <hello@ezaquarii.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>
        <import type="android.view.View" />
        <variable name="vm" type="com.nextcloud.client.logger.ui.LogsViewModel" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <include layout="@layout/toolbar_standard" />

        <ProgressBar
            android:id="@+id/logs_loading_progress"
            android:visibility="@{safeUnbox(vm.isLoading) ? View.VISIBLE : View.GONE}"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:layout_gravity="center"/>

        <LinearLayout
            android:visibility="@{safeUnbox(vm.isLoading) ? View.INVISIBLE : View.VISIBLE}"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:orientation="vertical">

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/logsList"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"/>

            <TextView
                android:id="@+id/logs_status"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textSize="12sp"
                android:text="@{vm.status}"/>
        </LinearLayout>
    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
