<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/mediaAppBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?android:colorBackground"
        android:translationZ="5dp">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/mediaCollapsing"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:fitsSystemWindows="false"
            app:contentScrim="?android:colorBackground"
            app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

            <com.flaviofaria.kenburnsview.KenBurnsView
                android:id="@+id/mediaBanner"
                android:layout_width="match_parent"
                android:layout_height="384dp"
                android:scaleType="centerCrop"
                app:layout_collapseMode="parallax"
                tools:ignore="ContentDescription,ImageContrastCheck"
                tools:srcCompat="@tools:sample/backgrounds/scenic[0]" />

            <ImageView
                android:id="@+id/mediaBannerNoKen"
                android:layout_width="match_parent"
                android:layout_height="384dp"
                android:scaleType="centerCrop"
                app:layout_collapseMode="parallax"
                tools:ignore="ContentDescription,ImageContrastCheck"
                tools:srcCompat="@tools:sample/backgrounds/scenic[0]" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="false"
                android:src="@drawable/linear_gradient_bg"
                tools:ignore="ContentDescription" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:alpha="0.66"
                android:clickable="false"
                android:scaleY="-1"
                android:src="@drawable/linear_gradient_bg"
                tools:ignore="ContentDescription" />

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

                <LinearLayout
                    android:id="@+id/mediaTitleCollapseContainer"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginStart="140dp"
                    android:layout_marginEnd="16dp"
                    android:layout_marginBottom="16dp"
                    android:orientation="vertical"
                    android:paddingStart="16dp"
                    android:paddingEnd="16dp">

                    <TextView
                        android:id="@+id/mediaTitleCollapse"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:ellipsize="end"
                        android:focusable="true"
                        android:focusableInTouchMode="true"
                        android:fontFamily="@font/poppins_bold"
                        android:maxLines="4"
                        android:scrollHorizontally="false"
                        android:singleLine="false"
                        android:text="@string/slogan"
                        android:textSize="16sp"
                        android:textColor="?attr/colorOnBackground"
                        android:transitionName="mediaTitle" />

                    <TextView
                        android:id="@+id/mediaStatus"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:alpha="0.66"
                        android:ellipsize="marquee"
                        android:fontFamily="@font/poppins_bold"
                        android:marqueeRepeatLimit="marquee_forever"
                        android:paddingTop="4sp"
                        android:singleLine="true"
                        android:text="@string/status"
                        android:textColor="?attr/colorPrimary"
                        android:textSize="14sp"
                        tools:ignore="TextContrastCheck" />

                </LinearLayout>

                <Button
                    android:id="@+id/mediaAddToList"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="match_parent"
                    android:layout_height="48dp"
                    android:layout_gravity="bottom"
                    android:layout_marginStart="32dp"
                    android:layout_marginEnd="32dp"
                    android:ellipsize="marquee"
                    android:fontFamily="@font/poppins_bold"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:padding="8dp"
                    android:singleLine="true"
                    android:text="@string/add"
                    android:textAllCaps="true"
                    android:textColor="?attr/colorPrimary"
                    app:strokeColor="?attr/colorPrimary"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    app:cornerRadius="16dp"
                    tools:ignore="SmallSp,TextContrastCheck" />

            </LinearLayout>

        </com.google.android.material.appbar.CollapsingToolbarLayout>

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

            <FrameLayout
                android:id="@+id/mediaTitleContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:minHeight="64dp"
                android:orientation="horizontal"
                app:layout_scrollFlags="scroll|enterAlways|snap"
                tools:ignore="UselessParent">


                <TextView
                    android:id="@+id/mediaTitle"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center_vertical"
                    app:contentScrim="?android:colorBackground"
                    android:ellipsize="marquee"
                    android:focusable="true"
                    android:focusableInTouchMode="true"
                    android:fontFamily="@font/poppins_bold"
                    android:gravity="center_vertical"
                    android:marqueeRepeatLimit="marquee_forever"
                    android:paddingStart="32dp"
                    android:paddingEnd="64dp"
                    android:scrollHorizontally="true"
                    android:singleLine="true"
                    android:text="@string/slogan"
                    android:textSize="16sp"
                    android:transitionName="mediaTitle"
                    tools:visibility="gone" />

                <LinearLayout
                    android:id="@+id/mediaAccessContainer"
                    android:layout_width="match_parent"
                    android:layout_height="60dp"
                    android:layout_gravity="end"
                    android:gravity="center_horizontal|center_vertical"
                    android:paddingStart="32dp"
                    android:paddingEnd="32dp">

                    <TextView
                        android:id="@+id/mediaTotal"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:ellipsize="end"
                        android:fontFamily="@font/poppins_family"
                        android:lineSpacingExtra="-8sp"
                        android:marqueeRepeatLimit="marquee_forever"
                        android:maxLines="2"
                        android:textColor="?attr/colorOnBackground"
                        android:textSize="16sp"
                        tools:text="Watched 10 out of 10" />

                    <ImageView
                        android:id="@+id/mediaFav"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_margin="8dp"
                        android:padding="8dp"
                        android:tintMode="src_atop"
                        app:srcCompat="@drawable/ic_round_favorite_border_24"
                        app:tint="?attr/colorSecondary"
                        tools:ignore="ContentDescription,ImageContrastCheck" />

                    <ImageView
                        android:id="@+id/mediaNotify"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_marginStart="-8dp"
                        android:padding="8dp"
                        app:srcCompat="@drawable/ic_round_share_24"
                        app:tint="?attr/colorSecondary"
                        app:tintMode="src_atop"
                        tools:ignore="ContentDescription,ImageContrastCheck" />

                </LinearLayout>
            </FrameLayout>

        </LinearLayout>
    </com.google.android.material.appbar.AppBarLayout>


    <LinearLayout
        android:layout_width="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:orientation="vertical"
        android:layout_height="match_parent">

        <androidx.viewpager2.widget.ViewPager2
            android:id="@+id/mediaViewPager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:nestedScrollingEnabled="false"
            tools:ignore="SpeakableTextPresentCheck" />
    </LinearLayout>

    <ani.dantotsu.CustomBottomNavBar
        android:id="@+id/mediaTab"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="0dp"
        android:layout_gravity="bottom"
        android:background="?attr/colorSurface"
        android:translationZ="1dp"
        app:itemActiveIndicatorStyle="@style/BottomNavBar"
        app:itemIconTint="@color/tab_layout_icon"
        app:itemRippleColor="?attr/colorPrimary"
        app:itemTextAppearanceActive="@style/NavBarText"
        app:itemTextAppearanceInactive="@style/NavBarText"
        app:itemTextColor="@color/tab_layout_icon"
        app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />

    <androidx.cardview.widget.CardView
        android:id="@+id/mediaClose"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_gravity="end"
        android:layout_margin="16dp"
        android:translationZ="7dp"
        app:cardBackgroundColor="@color/nav_bg"
        app:cardCornerRadius="16dp">

        <androidx.constraintlayout.utils.widget.ImageFilterView
            android:id="@+id/mediaCloseImage"
            android:layout_width="24dp"
            android:layout_height="24dp"
            android:layout_gravity="center"
            android:src="@drawable/ic_round_close_24"
            tools:ignore="ContentDescription" />
    </androidx.cardview.widget.CardView>

    <androidx.cardview.widget.CardView
        android:id="@+id/mediaCover"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="start|top"
        android:translationZ="5dp"
        app:cardCornerRadius="16dp"
        app:cardElevation="16dp"
        app:layout_anchor="@id/mediaTitleCollapseContainer"
        app:layout_anchorGravity="bottom">

        <com.google.android.material.imageview.ShapeableImageView
            android:id="@+id/mediaCoverImage"
            android:layout_width="108dp"
            android:layout_height="160dp"
            android:scaleType="centerCrop"
            android:transitionName="mediaCover"
            app:shapeAppearanceOverlay="@style/roundedImageView"
            tools:ignore="ContentDescription,ImageContrastCheck"
            tools:srcCompat="@tools:sample/backgrounds/scenic[2]" />
    </androidx.cardview.widget.CardView>
    <FrameLayout
        android:id="@+id/fragmentExtensionsContainer"
        android:paddingTop="16dp"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone">
    </FrameLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>