<?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"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.appbar.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:scrimAnimationDuration="200"
            app:titleEnabled="false"
            app:layout_scrollFlags="scroll|exitUntilCollapsed">

            <ImageView
                android:id="@+id/imgvBackground"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@color/image_readability_tint"
                android:scaleType="fitStart"
                app:layout_collapseMode="parallax"
                app:layout_collapseParallaxMultiplier="0.6" />

            <include
                android:id="@+id/header"
                layout="@layout/feeditemlist_header"
                app:layout_collapseMode="parallax" />

            <com.google.android.material.appbar.MaterialToolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentTop="true"
                android:minHeight="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:navigationContentDescription="@string/toolbar_back_button_content_description"
                app:navigationIcon="?homeAsUpIndicator" />

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

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

    <androidx.core.widget.NestedScrollView
        android:id="@+id/scrollView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipToPadding="false"
        android:paddingHorizontal="8dp"
        android:paddingBottom="8dp"
        android:scrollbarStyle="outsideOverlay"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:id="@+id/infoContainer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingHorizontal="@dimen/additional_horizontal_spacing">

            <LinearLayout
                android:id="@+id/statisticsHeading"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="8dp"
                android:layout_marginTop="16dp"
                android:orientation="horizontal">

                <TextView
                    android:id="@+id/statisticsHeadingLabel"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:text="@string/statistics_label"
                    android:layout_weight="1"
                    style="@style/TextAppearance.Material3.TitleMedium" />

                <Button
                    android:id="@+id/statisticsButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:minWidth="0dp"
                    android:minHeight="0dp"
                    android:text="@string/statistics_view_all"
                    style="@style/Widget.MaterialComponents.Button.TextButton" />

            </LinearLayout>

            <androidx.fragment.app.FragmentContainerView
                android:id="@+id/statisticsFragmentContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingHorizontal="4dp"
                tools:layout_height="20dp"
                tools:background="@color/image_readability_tint" />

            <TextView
                android:id="@+id/supportHeadingLabel"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:layout_marginBottom="4dp"
                android:paddingHorizontal="8dp"
                android:text="@string/support_funding_label"
                style="@style/TextAppearance.Material3.TitleMedium" />

            <TextView
                android:id="@+id/supportUrl"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:maxLines="8"
                android:paddingHorizontal="8dp"
                android:linksClickable="true"
                android:autoLink="web"
                style="@style/TextAppearance.Material3.BodyMedium"
                tools:text="Support this podcast" />

            <TextView
                android:id="@+id/descriptionHeadingLabel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:paddingHorizontal="8dp"
                android:layout_marginBottom="4dp"
                android:text="@string/description_label"
                style="@style/TextAppearance.Material3.TitleMedium" />

            <TextView
                android:id="@+id/descriptionLabel"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textIsSelectable="true"
                android:paddingHorizontal="8dp"
                style="@style/TextAppearance.Material3.BodyMedium"
                tools:text="Description" />

            <TextView
                android:id="@+id/urlHeadingLabel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:paddingHorizontal="8dp"
                android:text="@string/url_label"
                style="@style/TextAppearance.Material3.TitleMedium" />

            <TextView
                android:id="@+id/urlLabel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="?attr/selectableItemBackground"
                android:maxLines="4"
                android:paddingTop="4dp"
                android:paddingBottom="4dp"
                android:paddingHorizontal="8dp"
                android:drawablePadding="4dp"
                style="@style/TextAppearance.Material3.BodyMedium"
                tools:text="http://www.example.com/feed" />

        </LinearLayout>

    </androidx.core.widget.NestedScrollView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
