<!--
  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:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="io.timelimit.android.ui.overview.uninstall.UninstallFragment">

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

        <variable
            name="showBackdoorButton"
            type="boolean" />
    </data>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/coordinator">

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

            <androidx.cardview.widget.CardView
                android:layout_marginBottom="8dp"
                android:visibility="@{BuildConfig.storeCompilant ? View.VISIBLE : View.GONE}"
                app:cardUseCompatPadding="true"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <LinearLayout
                    android:background="@color/background_red"
                    android:padding="8dp"
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:textColor="@color/white"
                        android:textAppearance="?android:textAppearanceLarge"
                        android:text="@string/uninstall_gplay_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <TextView
                        android:textColor="@color/white"
                        android:textAppearance="?android:textAppearanceMedium"
                        android:text="@string/uninstall_gplay_text"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                </LinearLayout>
            </androidx.cardview.widget.CardView>

            <TextView
                android:layout_marginBottom="8dp"
                android:textAppearance="?android:textAppearanceSmall"
                android:text="@string/uninstall_reset_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <CheckBox
                android:id="@+id/check_confirm"
                android:text="@string/uninstall_reset_check_conirm"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <Button
                style="@style/DangerButton"
                android:layout_marginEnd="8dp"
                android:layout_marginTop="8dp"
                android:layout_gravity="end"
                android:id="@+id/uninstall"
                android:text="@string/generic_ok"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

            <Button
                android:visibility="@{showBackdoorButton ? View.VISIBLE : View.GONE}"
                android:id="@+id/backdoor_button"
                style="?materialButtonOutlinedStyle"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp"
                android:text="@string/backdoor_start_btn"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </LinearLayout>

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/fab"
            app:fabSize="normal"
            android:src="@drawable/ic_lock_open_white_24dp"
            android:layout_margin="16dp"
            android:layout_gravity="end|bottom"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

    </androidx.coordinatorlayout.widget.CoordinatorLayout>
</layout>
