<?xml version="1.0" encoding="utf-8"?><!--
  ~ DSBDirect
  ~ Copyright (C) 2019 Fynn Godau
  ~
  ~ 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, 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 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/>.
  ~
  ~ This software is not affiliated with heinekingmedia GmbH, the
  ~ developer of the DSB platform.
  -->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:app="http://schemas.android.com/apk/res-auto"
                xmlns:tools="http://schemas.android.com/tools"
                android:id="@+id/root"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:context="godau.fynn.dsbdirect.activity.MainActivity"
        >

    <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            android:elevation="4dp"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
            app:titleTextColor="@color/titleText"
            />

    <androidx.coordinatorlayout.widget.CoordinatorLayout
            android:id="@+id/contentCoordinator"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@id/page"
            android:layout_below="@id/toolbar"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            >

        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
                android:id="@+id/swipe_layout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >

            <RelativeLayout
                    android:id="@+id/content"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    >

                <TextView
                        android:id="@+id/text"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerHorizontal="true"
                        android:layout_centerVertical="true"
                        android:layout_margin="8dp"
                        android:foregroundGravity="center"
                        android:text="@string/initializing"
                        />

                <Button
                        android:id="@+id/fix"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/text"
                        android:layout_centerHorizontal="true"
                        android:layout_centerVertical="true"
                        android:layout_margin="8dp"
                        android:text="@string/news_fix"
                        android:visibility="gone"
                        />

                <Button
                        android:id="@+id/reauthenticate"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/fix"
                        android:layout_centerHorizontal="true"
                        android:layout_centerVertical="true"
                        android:layout_margin="8dp"
                        android:text="@string/action_reauth"
                        android:visibility="gone"
                        />

                <androidx.core.widget.NestedScrollView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:id="@+id/nestedScroll">

                    <!-- WebView is created dynamically here -->

                </androidx.core.widget.NestedScrollView>

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

                    <TextView
                        android:id="@+id/date"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:padding="8dp"
                        android:textSize="16pt"
                        android:textColor="?attr/TextOverBackground"
                        android:visibility="gone"
                        />

                    <androidx.recyclerview.widget.RecyclerView
                        android:id="@+id/table"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_below="@id/date"
                        android:layout_alignParentTop="false"
                        android:layout_alignParentBottom="true"
                        android:clipToPadding="false"
                        android:listSelector="@android:color/transparent"
                        android:transcriptMode="disabled"
                        android:visibility="gone"
                        />

                </RelativeLayout>

                <com.ortiz.touchview.TouchImageView
                        android:id="@+id/tableimage"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_alignParentTop="true"
                        android:visibility="gone"
                        />

            </RelativeLayout>
        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <com.wefika.horizontalpicker.HorizontalPicker
            android:id="@+id/page"
            android:layout_width="wrap_content"
            android:layout_height="50dp"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentBottom="true"
            android:layout_gravity="bottom"
            android:background="@color/colorPrimary"
            android:textColor="@color/white"
            android:textSize="14sp"
            android:visibility="gone"
            />

</RelativeLayout>
