<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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/animeContainer"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginStart="-16dp"
    android:layout_marginEnd="-16dp"
    android:orientation="vertical">

    <include layout="@layout/layout_trending" />

    <HorizontalScrollView
        android:id="@+id/animeSeasons"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:clipToPadding="false"
        android:fillViewport="true"
        android:paddingStart="2dp"
        android:paddingEnd="2dp"
        android:scrollbarSize="0dp">

        <LinearLayout
            android:id="@+id/animeSeasonsCont"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <com.google.android.material.chip.Chip
                android:id="@+id/animeThisSeason"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:text="@string/this_season"
                android:textAppearance="@style/Suffix"
                app:chipStrokeColor="?attr/colorPrimaryContainer"
                app:layout_constraintBaseline_toBaselineOf="@+id/animeNextSeason"
                app:layout_constraintEnd_toStartOf="@+id/animeNextSeason"
                app:layout_constraintStart_toStartOf="parent" />

            <com.google.android.material.chip.Chip
                android:id="@+id/animeNextSeason"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:text="@string/next_season"
                android:textAppearance="@style/Suffix"
                app:chipStrokeColor="?attr/colorPrimaryContainer" />

            <com.google.android.material.chip.Chip
                android:id="@+id/animePreviousSeason"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="8dp"
                android:text="@string/previous_season"
                android:textAppearance="@style/Suffix"
                app:chipStrokeColor="?attr/colorPrimaryContainer"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent" />
        </LinearLayout>

    </HorizontalScrollView>


    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/animeListContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipToPadding="false"
        android:paddingStart="24dp"
        android:paddingEnd="24dp">

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/animeGenre"
            android:layout_width="match_parent"
            android:layout_height="72dp"
            android:layout_margin="8dp"
            app:cardCornerRadius="16dp"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@+id/animeCalendar"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="256dp">

            <ImageView
                android:id="@+id/animeGenreImage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                tools:ignore="ContentDescription"
                tools:src="@tools:sample/backgrounds/scenic" />

            <View
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:alpha="0.75"
                android:background="@color/bg_black" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:fontFamily="@font/poppins_bold"
                    android:text="@string/genres"
                    android:textAllCaps="true"
                    android:textColor="@color/bg_white"
                    android:textSize="16sp" />

                <View
                    android:layout_width="64dp"
                    android:layout_height="2dp"
                    android:layout_gravity="center"
                    android:background="?attr/colorPrimary" />
            </LinearLayout>
        </com.google.android.material.card.MaterialCardView>

        <com.google.android.material.card.MaterialCardView
            android:id="@+id/animeCalendar"
            android:layout_width="match_parent"
            android:layout_height="72dp"
            android:layout_margin="8dp"
            android:layout_marginBottom="16dp"
            app:cardCornerRadius="16dp"
            app:layout_constrainedWidth="true"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/animeGenre"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="256dp">

            <ImageView
                android:id="@+id/animeCalendarImage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"
                tools:ignore="ContentDescription"
                tools:src="@tools:sample/backgrounds/scenic" />

            <View
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:alpha="0.75"
                android:background="@color/bg_black" />

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:fontFamily="@font/poppins_bold"
                    android:text="@string/release_calendar"
                    android:textAllCaps="true"
                    android:textColor="@color/bg_white"
                    android:textSize="16sp" />

                <View
                    android:layout_width="64dp"
                    android:layout_height="2dp"
                    android:layout_gravity="center"
                    android:background="?attr/colorPrimary" />
            </LinearLayout>

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

    </androidx.constraintlayout.widget.ConstraintLayout>

    <LinearLayout
        android:id="@+id/animeRecentlyContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:id="@+id/animeRecently"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="24dp"
            android:fontFamily="@font/poppins_bold"
            android:padding="8dp"
            android:text="@string/updated"
            android:textSize="16sp"
            android:visibility="invisible"
            tools:visibility="visible" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:minHeight="250dp">

            <ProgressBar
                android:id="@+id/animeUpdatedProgressBar"
                style="?android:attr/progressBarStyle"
                android:layout_width="wrap_content"
                android:layout_height="48dp"
                android:layout_gravity="center" />

            <ani.dantotsu.FadingEdgeRecyclerView
                android:id="@+id/animeUpdatedRecyclerView"
                android:layout_width="match_parent"
                android:layout_height="250dp"
                android:clipToPadding="false"
                android:nestedScrollingEnabled="true"
                android:paddingStart="20dp"
                android:paddingEnd="20dp"
                android:requiresFadingEdge="horizontal"
                tools:itemCount="4"
                tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:listitem="@layout/item_media_compact"
                tools:orientation="horizontal" />

        </FrameLayout>
    </LinearLayout>

    <TextView
        android:id="@+id/animeMovies"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:fontFamily="@font/poppins_bold"
        android:padding="8dp"
        android:text="@string/trending_movies"
        android:textSize="16sp"
        android:visibility="invisible"
        tools:visibility="visible" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="250dp">

        <ProgressBar
            android:id="@+id/animeMoviesProgressBar"
            style="?android:attr/progressBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_gravity="center" />

        <ani.dantotsu.FadingEdgeRecyclerView
            android:id="@+id/animeMoviesRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:clipToPadding="false"
            android:nestedScrollingEnabled="true"
            android:paddingStart="20dp"
            android:paddingEnd="20dp"
            android:requiresFadingEdge="horizontal"
            tools:itemCount="4"
            tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/item_media_compact"
            tools:orientation="horizontal" />

    </FrameLayout>

    <TextView
        android:id="@+id/animeTopRated"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:fontFamily="@font/poppins_bold"
        android:padding="8dp"
        android:text="@string/top_rated"
        android:textSize="16sp"
        android:visibility="invisible"
        tools:visibility="visible" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="250dp">

        <ProgressBar
            android:id="@+id/animeTopRatedProgressBar"
            style="?android:attr/progressBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_gravity="center" />

        <ani.dantotsu.FadingEdgeRecyclerView
            android:id="@+id/animeTopRatedRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:clipToPadding="false"
            android:nestedScrollingEnabled="true"
            android:paddingStart="20dp"
            android:paddingEnd="20dp"
            android:requiresFadingEdge="horizontal"
            tools:itemCount="4"
            tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/item_media_compact"
            tools:orientation="horizontal" />

    </FrameLayout>

    <TextView
        android:id="@+id/animeMostFav"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:fontFamily="@font/poppins_bold"
        android:padding="8dp"
        android:text="@string/most_favourite"
        android:textSize="16sp"
        android:visibility="invisible"
        tools:visibility="visible" />

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="250dp">

        <ProgressBar
            android:id="@+id/animeMostFavProgressBar"
            style="?android:attr/progressBarStyle"
            android:layout_width="wrap_content"
            android:layout_height="48dp"
            android:layout_gravity="center" />

        <ani.dantotsu.FadingEdgeRecyclerView
            android:id="@+id/animeMostFavRecyclerView"
            android:layout_width="match_parent"
            android:layout_height="250dp"
            android:clipToPadding="false"
            android:nestedScrollingEnabled="true"
            android:paddingStart="20dp"
            android:paddingEnd="20dp"
            android:requiresFadingEdge="horizontal"
            tools:itemCount="4"
            tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:listitem="@layout/item_media_compact"
            tools:orientation="horizontal" />

    </FrameLayout>

    <LinearLayout
        android:id="@+id/animePopular"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="24dp"
        android:layout_marginEnd="24dp"
        android:orientation="horizontal"
        android:visibility="invisible">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:fontFamily="@font/poppins_bold"
            android:padding="8dp"
            android:text="@string/popular_anime"
            android:textSize="16sp" />

        <com.google.android.material.materialswitch.MaterialSwitch
            android:id="@+id/animeIncludeList"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:checked="true"
            android:fontFamily="@font/poppins_bold"
            android:text="@string/include_media_in_list"
            android:textSize="12sp" />

    </LinearLayout>

</LinearLayout>
