<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <com.kabouzeid.gramophone.views.StatusBarView
            android:id="@+id/player_status_bar"
            android:layout_width="match_parent"
            android:layout_height="@dimen/status_bar_padding" />

        <com.kabouzeid.gramophone.views.StatusBarView
            android:layout_width="match_parent"
            android:layout_height="@dimen/status_bar_padding"
            android:background="@color/twenty_percent_black_overlay" />

    </FrameLayout>

    <com.sothree.slidinguppanel.SlidingUpPanelLayout
        xmlns:sothree="http://schemas.android.com/apk/res-auto"
        android:id="@+id/player_sliding_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="false"
        android:focusable="true"
        android:gravity="bottom"
        sothree:umanoPanelHeight="0dp"
        sothree:umanoScrollableView="@+id/player_recycler_view"
        sothree:umanoShadowHeight="0dp">

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <FrameLayout
                android:id="@+id/player_content"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.kabouzeid.gramophone.views.WidthFitSquareLayout
                    android:id="@+id/album_cover_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <fragment
                        android:id="@+id/player_album_cover_fragment"
                        class="com.kabouzeid.gramophone.ui.fragments.player.PlayerAlbumCoverFragment"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content" />

                </com.kabouzeid.gramophone.views.WidthFitSquareLayout>

            </FrameLayout>

            <FrameLayout
                android:id="@+id/toolbar_container"
                android:layout_width="match_parent"
                android:layout_height="@dimen/toolbar_scrim_height"
                android:background="@drawable/toolbar_gradient">

                <android.support.v7.widget.Toolbar
                    android:id="@+id/player_toolbar"
                    style="@style/Toolbar"
                    android:background="@android:color/transparent" />

            </FrameLayout>

        </FrameLayout>

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

            <fragment
                android:id="@+id/playback_controls_fragment"
                class="com.kabouzeid.gramophone.ui.fragments.player.flat.FlatPlayerPlaybackControlsFragment"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <!--This is necessary for the drag sorting to work at the top-->
                <View
                    android:id="@+id/draggable_area"
                    android:layout_width="72dp"
                    android:layout_height="wrap_content"
                    android:layout_alignBottom="@+id/player_panel_content"
                    android:layout_alignTop="@+id/player_panel_content"
                    android:layout_marginTop="128dp" />

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

                    <View
                        android:layout_width="match_parent"
                        android:layout_height="4dp"
                        android:layout_marginBottom="4dp"
                        android:background="@drawable/shadow_down" />

                    <include
                        android:id="@+id/current_song"
                        layout="@layout/item_list" />

                    <TextView
                        android:id="@+id/player_queue_sub_header"
                        android:layout_width="match_parent"
                        android:layout_height="48dp"
                        android:gravity="center_vertical"
                        android:paddingLeft="16dp"
                        android:paddingRight="16dp"
                        android:text="@string/up_next"
                        android:textAppearance="@style/TextAppearance.AppCompat.Body2"
                        android:textColor="?android:textColorSecondary" />

                    <android.support.v7.widget.RecyclerView
                        android:id="@+id/player_recycler_view"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:requiresFadingEdge="vertical" />

                </LinearLayout>

            </RelativeLayout>

        </LinearLayout>

    </com.sothree.slidinguppanel.SlidingUpPanelLayout>

</LinearLayout>
