<?xml version="1.0" encoding="utf-8"?>
<!--
  TimeLimit Copyright <C> 2019 - 2020 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:tools="http://schemas.android.com/tools">
    <data>
        <variable
            name="showWarningMessage"
            type="boolean" />

        <variable
            name="blockedElement"
            type="String" />

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

    <RelativeLayout
        android:background="?colorSurface"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

            <ImageView
                android:layout_gravity="center_horizontal"
                android:src="@mipmap/ic_launcher"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

            <TextView
                tools:text="@string/lock_overlay_text"
                android:text="@{@string/lock_overlay_text(blockedElement)}"
                android:visibility="@{TextUtils.isEmpty(blockedElement) ? View.GONE : View.VISIBLE}"
                android:layout_marginTop="16dp"
                android:gravity="center_horizontal"
                android:textAppearance="?android:textAppearanceMedium"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <TextView
                android:layout_marginTop="16dp"
                android:visibility="@{showWarningMessage ? View.VISIBLE : View.GONE}"
                android:gravity="center_horizontal"
                android:textAppearance="?android:textAppearanceMedium"
                android:text="@string/lock_overlay_warning"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </LinearLayout>

        <TextView
            android:layout_margin="8dp"
            android:gravity="center_horizontal"
            android:textAppearance="?android:textAppearanceSmall"
            android:text="@string/app_name"
            android:layout_alignParentBottom="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </RelativeLayout>
</layout>