<!--
  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
    tools:context="io.timelimit.android.ui.setup.SetupTermsFragment"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

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

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

        <ScrollView
            android:layout_weight="1"
            android:layout_width="match_parent"
            android:layout_height="0dp">
            <LinearLayout
                android:padding="8dp"
                android:orientation="vertical"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

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

                <TextView
                    android:visibility="@{BuildConfig.hasServer ? View.VISIBLE : View.GONE}"
                    android:id="@+id/terms_text_1"
                    android:textAppearance="?android:textAppearanceMedium"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/terms_default_server" />

                <LinearLayout
                    android:visibility="@{BuildConfig.hasServer ? View.VISIBLE : View.GONE}"
                    android:orientation="vertical"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:textAppearance="?android:textAppearanceMedium"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <TextView
                        android:textAppearance="?android:textAppearanceMedium"
                        android:text="@string/custom_server_status_disabled"
                        android:id="@+id/custom_server_status"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                    <Button
                        android:id="@+id/custom_server_button"
                        android:text="@string/select_custom_server_button"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content" />
                </LinearLayout>

                <TextView
                    android:id="@+id/terms_text_2"
                    android:textAppearance="?android:textAppearanceMedium"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/terms_gpl" />

            </LinearLayout>
        </ScrollView>

        <LinearLayout
            android:padding="8dp"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <View
                android:layout_weight="1"
                android:layout_width="0dp"
                android:layout_height="0dp" />
            <Button
                android:background="?selectableItemBackground"
                android:id="@+id/btn_accept"
                android:text="@string/terms_btn_accept"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </LinearLayout>
    </LinearLayout>

</layout>