<?xml version="1.0" encoding="utf-8"?>
<org.oxycblt.auxio.ui.coordinator.EdgeCoordinatorLayout 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/home_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/colorSurface">

    <org.oxycblt.auxio.ui.coordinator.EdgeAppBarLayout
        android:id="@+id/home_appbar"
        style="@style/Widget.Auxio.AppBarLayout"
        app:liftOnScroll="true">

        <com.google.android.material.appbar.MaterialToolbar
            android:id="@+id/home_toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_scrollFlags="scroll|enterAlways"
            app:menu="@menu/menu_home"
            app:title="@string/info_app_name" />

        <com.google.android.material.tabs.TabLayout
            android:id="@+id/home_tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            app:tabContentStart="@dimen/spacing_medium"
            app:tabGravity="start"
            app:tabMode="scrollable" />

    </org.oxycblt.auxio.ui.coordinator.EdgeAppBarLayout>


    <FrameLayout
        android:id="@+id/home_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:animateLayoutChanges="true"
        android:clipToPadding="false"
        app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior">

        <androidx.viewpager2.widget.ViewPager2
            android:id="@+id/home_pager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"
            tools:layout="@layout/fragment_home_list" />

        <org.oxycblt.auxio.home.EdgeFrameLayout
            android:id="@+id/home_indexing_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="@dimen/spacing_medium"
            android:visibility="invisible">

            <com.google.android.material.card.MaterialCardView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center">

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:animateLayoutChanges="true">

                    <TextView
                        android:id="@+id/home_indexing_status"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="@dimen/spacing_medium"
                        android:gravity="center"
                        android:textAppearance="@style/TextAppearance.Auxio.BodyLarge"
                        app:layout_constraintBottom_toTopOf="@+id/home_indexing_action"
                        app:layout_constraintTop_toTopOf="parent"
                        app:layout_constraintVertical_chainStyle="packed"
                        tools:text="Status" />

                    <com.google.android.material.progressindicator.LinearProgressIndicator
                        android:id="@+id/home_indexing_progress"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="@dimen/spacing_medium"
                        android:layout_marginEnd="@dimen/spacing_medium"
                        android:indeterminate="true"
                        app:indeterminateAnimationType="disjoint"
                        app:layout_constraintBottom_toBottomOf="@+id/home_indexing_action"
                        app:layout_constraintTop_toTopOf="@+id/home_indexing_action"
                        app:trackColor="@color/sel_track" />

                    <Button
                        android:id="@+id/home_indexing_action"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="@dimen/spacing_medium"
                        android:layout_marginEnd="@dimen/spacing_medium"
                        android:layout_marginBottom="@dimen/spacing_medium"
                        android:text="@string/lbl_retry"
                        android:visibility="invisible"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintTop_toBottomOf="@+id/home_indexing_status" />

                </androidx.constraintlayout.widget.ConstraintLayout>

            </com.google.android.material.card.MaterialCardView>

        </org.oxycblt.auxio.home.EdgeFrameLayout>

    </FrameLayout>

    <org.oxycblt.auxio.home.EdgeFrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_anchor="@id/home_content"
        app:layout_anchorGravity="bottom|end">

        <com.google.android.material.floatingactionbutton.FloatingActionButton
            android:id="@+id/home_fab"
            style="@style/Widget.Auxio.FloatingActionButton.Adaptive"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/spacing_medium"
            android:contentDescription="@string/desc_shuffle_all"
            android:src="@drawable/ic_shuffle_off_24" />

    </org.oxycblt.auxio.home.EdgeFrameLayout>

</org.oxycblt.auxio.ui.coordinator.EdgeCoordinatorLayout>
