<?xml version="1.0" encoding="utf-8"?><!--
  ~ Aurora Store
  ~ Copyright (C) 2019, Rahul Kumar Patel <whyorean@gmail.com>
  ~
  ~ Aurora Store 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 2 of the License, or
  ~ (at your option) any later version.
  ~
  ~ Aurora Store 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 Aurora Store.  If not, see <http://www.gnu.org/licenses/>.
  ~
  ~
  -->

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".ui.accounts.AccountsActivity">

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:fillViewport="true"
        android:scrollbars="none">

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

            <HorizontalScrollView
                android:id="@+id/chip_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:paddingStart="@dimen/margin_small"
                android:paddingTop="@dimen/margin_normal"
                android:paddingEnd="@dimen/margin_small"
                android:paddingBottom="@dimen/margin_small">

                <com.google.android.material.chip.ChipGroup
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal">

                    <com.google.android.material.chip.Chip
                        android:id="@+id/chip_tos"
                        style="@style/Widget.Aurora.Chip.Info"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_terms" />

                    <com.google.android.material.chip.Chip
                        android:id="@+id/chip_disclaimer"
                        style="@style/Widget.Aurora.Chip.Info"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_disclaimer" />

                    <com.google.android.material.chip.Chip
                        android:id="@+id/chip_license"
                        style="@style/Widget.Aurora.Chip.Info"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/menu_license" />

                </com.google.android.material.chip.ChipGroup>

            </HorizontalScrollView>

            <ViewSwitcher
                android:id="@+id/view_switcher_top"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/chip_layout">

                <LinearLayout
                    android:id="@+id/init"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <include layout="@layout/include_accounts_init" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/info"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent">

                    <include layout="@layout/include_accounts_info" />
                </LinearLayout>
            </ViewSwitcher>


            <ViewSwitcher
                android:id="@+id/view_switcher_bottom"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@id/view_switcher_top">

                <LinearLayout
                    android:id="@+id/login"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center">

                    <include layout="@layout/include_accounts_login" />
                </LinearLayout>

                <LinearLayout
                    android:id="@+id/logout"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="center">

                    <include layout="@layout/include_accounts_logout" />
                </LinearLayout>
            </ViewSwitcher>

            <ProgressBar
                android:id="@+id/progress_bar"
                android:layout_width="36dp"
                android:layout_height="36dp"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:layout_margin="@dimen/margin_small"
                android:indeterminate="true"
                android:indeterminateTint="@color/colorAccent"
                android:visibility="invisible" />
        </RelativeLayout>
    </androidx.core.widget.NestedScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>