<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/app_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/transparent"
            app:elevation="0dp">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="0dp"
                app:layout_scrollFlags="scroll"
                app:contentInsetStart="0dp"
                app:contentInsetEnd="0dp">
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:layout_width="match_parent"
                        android:layout_height="220dp">

                        <ImageView
                            android:id="@+id/image_playlist_thumbnail"
                            android:layout_width="match_parent"
                            android:layout_height="0dp"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintTop_toTopOf="parent"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:srcCompat="@drawable/background_thumbnail_live"
                            android:scaleType="centerCrop" />

                        <ImageView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:srcCompat="@drawable/bottom_gradient"
                            android:scaleType="fitXY" />



                        <ImageButton
                            android:id="@+id/button_share"
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            android:contentDescription="@string/cd_button_share"
                            android:background="@drawable/background_button_round"
                            android:gravity="center"
                            android:layout_marginStart="5dp"
                            android:orientation="horizontal"
                            app:srcCompat="@drawable/ic_share"
                            app:tint="@color/white"
                            android:padding="10dp"
                            app:layout_constraintRight_toRightOf="parent"
                            app:layout_constraintTop_toTopOf="parent"
                            android:layout_margin="10dp"
                            android:scaleType="fitCenter" />
                    </androidx.constraintlayout.widget.ConstraintLayout>
                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:layout_width="match_parent"
                        android:layout_height="120dp"
                        android:layout_marginTop="-90dp"
                        android:layout_marginStart="20dp"
                        app:layout_constraintBottom_toBottomOf="parent">
                        <TextView
                            android:id="@+id/text_name"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/inter_medium"
                            android:textColor="@color/white"
                            android:textSize="18dp"
                            tools:text="Playlist name"
                            app:layout_constraintLeft_toLeftOf="@id/container_buttons"
                            app:layout_constraintBottom_toTopOf="@id/text_metadata"/>

                        <TextView
                            android:id="@+id/text_metadata"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:fontFamily="@font/inter_extra_light"
                            android:textColor="@color/gray_e0"
                            android:textSize="14dp"
                            tools:text="3 videos"
                            android:layout_marginBottom="15dp"
                            app:layout_constraintLeft_toLeftOf="@id/container_buttons"
                            app:layout_constraintBottom_toTopOf="@id/container_buttons" />

                        <LinearLayout
                            android:id="@+id/container_buttons"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            app:layout_constraintLeft_toLeftOf="parent"
                            app:layout_constraintBottom_toBottomOf="parent"
                            android:layout_marginStart="10dp"
                            android:orientation="horizontal">
                            <LinearLayout
                                android:id="@+id/button_play_all"
                                android:layout_width="120dp"
                                android:layout_height="40dp"
                                android:background="@drawable/background_button_primary_round"
                                android:gravity="center"
                                android:layout_marginBottom="10dp"
                                android:orientation="horizontal">

                                <ImageView
                                    android:layout_width="14dp"
                                    android:layout_height="14dp"
                                    android:scaleType="fitCenter"
                                    app:srcCompat="@drawable/ic_play_white_nopad"
                                    android:layout_marginEnd="10dp"/>

                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:fontFamily="@font/inter_light"
                                    android:textColor="@color/white"
                                    android:textSize="16dp"
                                    android:text="@string/play_all" />
                            </LinearLayout>

                            <LinearLayout
                                android:id="@+id/button_shuffle"
                                android:layout_width="120dp"
                                android:layout_height="40dp"
                                android:background="@drawable/background_button_round"
                                android:gravity="center"
                                android:layout_marginStart="5dp"
                                android:orientation="horizontal">

                                <ImageView
                                    android:layout_width="16dp"
                                    android:layout_height="16dp"
                                    android:scaleType="fitCenter"
                                    app:srcCompat="@drawable/ic_shuffle"
                                    android:layout_marginEnd="5dp"
                                    app:tint="@color/white" />

                                <TextView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:fontFamily="@font/inter_light"
                                    android:textColor="@color/white"
                                    android:textSize="16dp"
                                    android:text="@string/shuffle" />
                            </LinearLayout>
W
                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>
                </LinearLayout>
            </androidx.appcompat.widget.Toolbar>
        </com.google.android.material.appbar.AppBarLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_playlist"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <FrameLayout
        android:id="@+id/overlay_container"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone" />

    <FrameLayout
        android:id="@+id/layout_loading_overlay"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#77000000"
        android:visibility="gone">
        <ImageView
            android:id="@+id/image_loader"
            android:layout_width="80dp"
            android:layout_height="80dp"
            app:srcCompat="@drawable/ic_loader_animated"
            android:layout_gravity="center"
            android:alpha="0.7"
            android:layout_marginTop="80dp"
            android:contentDescription="@string/loading" />
    </FrameLayout>
</FrameLayout>