<?xml version="1.0" encoding="utf-8"?><!--
   Copyright 2017 Martijn Brekhof. All rights reserved.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/collapsed_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <com.google.android.material.imageview.ShapeableImageView
            android:id="@+id/poster"
            android:layout_width="@dimen/now_playing_panel_art_width"
            android:layout_height="@dimen/now_playing_panel_art_heigth"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:contentDescription="@string/poster"
            android:scaleType="centerCrop"
            app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Kore.Image.NowPlayingArt" />

        <ImageView
            android:id="@+id/drag_handle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="7dp"
            android:layout_marginBottom="4dp"
            android:src="@drawable/ic_bottom_sheet_drag_handle"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:tint="?attr/colorOnSurfaceVariant"
            android:alpha="0.4" />

        <TextView
            android:id="@+id/title"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintStart_toEndOf="@id/poster"
            app:layout_constraintEnd_toStartOf="@id/volume_muted_indicator"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toTopOf="@+id/details"
            app:layout_constraintVertical_chainStyle="packed"
            android:layout_marginStart="@dimen/small_padding"
            android:layout_marginEnd="@dimen/small_padding"
            android:gravity="center_horizontal"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.Kore.NowPlaying.Title" />

        <TextView
            android:id="@+id/details"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintStart_toStartOf="@id/title"
            app:layout_constraintEnd_toEndOf="@id/title"
            app:layout_constraintTop_toBottomOf="@id/title"
            app:layout_constraintBottom_toBottomOf="parent"
            android:layout_marginStart="@dimen/small_padding"
            android:layout_marginEnd="@dimen/small_padding"
            android:gravity="center_horizontal"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal"
            android:singleLine="true"
            android:textAppearance="@style/TextAppearance.Kore.NowPlaying.Details" />

        <org.xbmc.kore.ui.widgets.HighlightButton
            android:id="@+id/volume_muted_indicator"
            style="@style/Widget.Kore.Button.Borderless"
            android:layout_width="@dimen/default_icon_size"
            android:layout_height="@dimen/default_icon_size"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/play"
            android:contentDescription="@string/volume_mute"
            android:src="@drawable/ic_round_volume_off_24"
            android:visibility="gone" />

        <ImageButton
            android:id="@+id/play"
            style="@style/Widget.Kore.Button.Borderless"
            android:layout_width="@dimen/default_icon_size"
            android:layout_height="@dimen/default_icon_size"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            android:contentDescription="@string/play"
            android:src="@drawable/ic_round_play_arrow_24" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <!-- Progress bar -->
    <org.xbmc.kore.ui.widgets.MediaProgressIndicator
        android:id="@+id/progress_info"
        android:layout_width="match_parent"
        android:layout_height="@dimen/buttonbar_height"
        android:orientation="horizontal"
        android:paddingLeft="@dimen/default_padding"
        android:paddingRight="@dimen/default_padding" />

    <!-- Media playback control buttons -->
    <org.xbmc.kore.ui.widgets.MediaPlaybackBar
        android:id="@+id/media_playback_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/buttonbar_height"
        android:orientation="horizontal"
        app:view_mode="full" />

    <!-- Media action buttons -->
    <org.xbmc.kore.ui.widgets.MediaActionsBar
        android:id="@+id/media_actions_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/buttonbar_height"
        android:orientation="horizontal" />
</merge>