<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2014 The Android Open Source Project

     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.
-->

<!-- Note: clipChildren/clipToPadding false are needed to apply shadows to child
     views with no padding of their own. Also to allow for negative margin on description. -->

<androidx.leanback.widget.PlaybackControlsRowView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:paddingStart="?attr/playbackPaddingStart"
    android:paddingEnd="?attr/playbackPaddingEnd" >

    <LinearLayout
        android:id="@+id/controls_card"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/lb_playback_controls_margin_bottom"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:orientation="horizontal" >

        <ImageView
            android:id="@+id/image"
            android:layout_width="wrap_content"
            android:layout_height="@dimen/lb_playback_controls_card_height"
            android:adjustViewBounds="true"
            android:scaleType="fitStart" />

        <LinearLayout
            android:id="@+id/controls_card_right_panel"
            android:layout_gravity="bottom"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:orientation="vertical" >

            <FrameLayout
                android:id="@+id/description_dock"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="@dimen/lb_playback_description_margin_end"
                android:layout_marginStart="@dimen/lb_playback_description_margin_start"
                android:paddingTop="@dimen/lb_playback_description_margin_top"
                android:clipToPadding="false"
                android:clipChildren="false"
                android:gravity="top" />

            <Space
                android:id="@+id/spacer"
                android:layout_width="match_parent"
                android:layout_height="16dp" />

            <FrameLayout
                android:id="@+id/controls_dock"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:minHeight="@dimen/lb_control_button_height"
                android:layout_marginEnd="@dimen/lb_playback_description_margin_end"
                android:layout_marginStart="@dimen/lb_playback_description_margin_start" />
        </LinearLayout>
    </LinearLayout>

    <FrameLayout
        android:id="@+id/secondary_controls_dock"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal" />

    <Space
        android:id="@+id/bottom_spacer"
        android:layout_width="match_parent"
        android:layout_height="@dimen/lb_playback_controls_margin_bottom" />

</androidx.leanback.widget.PlaybackControlsRowView>
