1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  Copyright 2018, The Android Open Source Project
4
5  Licensed under the Apache License, Version 2.0 (the "License");
6  you may not use this file except in compliance with the License.
7  You may obtain a copy of the License at
8
9      http://www.apache.org/licenses/LICENSE-2.0
10
11  Unless required by applicable law or agreed to in writing, software
12  distributed under the License is distributed on an "AS IS" BASIS,
13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  See the License for the specific language governing permissions and
15  limitations under the License.
16-->
17<androidx.constraintlayout.widget.ConstraintLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto"
20    android:id="@+id/playback_container"
21    android:layout_width="match_parent"
22    android:layout_height="match_parent">
23
24    <androidx.constraintlayout.widget.Guideline
25        android:id="@+id/app_bar_guideline"
26        android:layout_width="wrap_content"
27        android:layout_height="wrap_content"
28        android:orientation="horizontal"
29        app:layout_constraintGuide_begin="@dimen/car_ui_toolbar_first_row_height"/>
30
31    <Space
32        android:id="@+id/control_bar_first_row_guideline"
33        android:layout_width="0dp"
34        android:layout_height="@dimen/control_bar_height"
35        android:layout_marginBottom="@dimen/control_bar_margin_bottom"
36        app:layout_constraintBottom_toBottomOf="parent"/>
37
38    <com.android.car.apps.common.BackgroundImageView
39        android:id="@+id/playback_background"
40        android:layout_width="match_parent"
41        android:layout_height="match_parent"/>
42
43    <include
44        layout="@layout/scrim_overlay"
45        android:id="@+id/background_scrim"
46        android:layout_width="0dp"
47        android:layout_height="0dp"
48        app:layout_constraintTop_toTopOf="parent"
49        app:layout_constraintBottom_toBottomOf="parent"
50        app:layout_constraintStart_toStartOf="parent"
51        app:layout_constraintEnd_toEndOf="parent"/>
52
53    <com.android.car.ui.toolbar.Toolbar
54        android:id="@+id/toolbar"
55        android:layout_width="match_parent"
56        android:layout_height="wrap_content"
57        app:title="@string/fragment_playback_title"
58        app:layout_constraintTop_toTopOf="parent"
59        app:car_ui_state="subpage"/>
60
61    <include
62        style="@style/MetadataContainerStyle"
63        android:id="@+id/metadata_container"
64        layout="@layout/metadata_normal"
65        app:layout_constraintStart_toStartOf="parent"
66        app:layout_constraintEnd_toEndOf="parent"
67        app:layout_constraintTop_toBottomOf="@id/app_bar_guideline"
68        app:layout_constraintBottom_toTopOf="@+id/control_bar_first_row_guideline"/>
69
70    <!-- @id/seek_bar should be hidden when @id/control_bar_scrim is expanded, and shown when the
71    scrim is collapsed. Since its visibility is also controlled by MetadataController, it could
72    become visible again even if the scrim is still expanded. To solve that we add a wrapper around
73    it and hide/show the wrapper when the scrim is expanded/collapsed.-->
74    <FrameLayout
75        style="@style/SeekBarStyle"
76        android:id="@+id/seek_bar_container"
77        android:layout_gravity="center"
78        android:layout_marginStart="@dimen/playback_seekbar_margin_x"
79        android:layout_marginEnd="@dimen/playback_seekbar_margin_x"
80        app:layout_constraintStart_toStartOf="parent"
81        app:layout_constraintEnd_toEndOf="parent"
82        app:layout_constraintTop_toBottomOf="@+id/metadata_container"
83        app:layout_constraintBottom_toTopOf="@+id/control_bar_first_row_guideline">
84        <SeekBar
85            android:id="@+id/seek_bar"
86            android:layout_width="match_parent"
87            android:layout_height="match_parent"
88            android:clickable="false"
89            android:focusable="false"
90            android:paddingEnd="@dimen/playback_seekbar_padding_x"
91            android:paddingStart="@dimen/playback_seekbar_padding_x"
92            android:progressDrawable="@drawable/seekbar_background"
93            android:thumb="@drawable/seekbar_thumb"
94            android:thumbOffset="@dimen/playback_seekbar_thumb_offset"
95            android:splitTrack="false"
96            android:progressTint="@color/progress_bar_highlight"
97            android:progressBackgroundTint="@color/progress_bar_background"
98            android:background="@null"/>
99    </FrameLayout>
100
101    <Space
102        android:id="@+id/queue_list_top_constraint"
103        android:layout_width="match_parent"
104        android:layout_height="@dimen/fragment_playback_queue_overlap_top"
105        app:layout_constraintBottom_toBottomOf="@+id/app_bar_guideline"/>
106
107    <Space
108        android:id="@+id/queue_list_bottom_constraint"
109        android:layout_width="match_parent"
110        android:layout_height="@dimen/fragment_playback_queue_overlap_bottom"
111        app:layout_constraintTop_toTopOf="@+id/control_bar_first_row_guideline"/>
112
113    <!-- The queue_container is a workaround for a bug in PagedRecyclerView (b/136669451). -->
114    <RelativeLayout
115        android:id="@+id/queue_container"
116        android:layout_width="match_parent"
117        android:layout_height="0dp"
118        app:layout_constraintTop_toTopOf="@+id/queue_list_top_constraint"
119        app:layout_constraintBottom_toBottomOf="@+id/queue_list_bottom_constraint">
120        <com.android.car.ui.recyclerview.CarUiRecyclerView
121            android:id="@+id/queue_list"
122            android:layout_width="match_parent"
123            android:layout_height="match_parent"
124            android:visibility="gone"
125            android:fadeScrollbars="true"
126            android:requiresFadingEdge="vertical"
127            android:fadingEdgeLength="@dimen/queue_fading_edge_length"/>
128    </RelativeLayout>
129
130    <include
131        layout="@layout/scrim_overlay"
132        android:id="@+id/control_bar_scrim"
133        android:layout_width="0dp"
134        android:layout_height="0dp"
135        app:layout_constraintTop_toTopOf="parent"
136        app:layout_constraintBottom_toBottomOf="parent"
137        app:layout_constraintStart_toStartOf="parent"
138        app:layout_constraintEnd_toEndOf="parent"/>
139
140    <com.android.car.media.common.PlaybackControlsActionBar
141        android:id="@+id/playback_controls"
142        style="@style/ControlBar"
143        android:layout_marginHorizontal="@dimen/control_bar_margin_x"
144        android:layout_marginBottom="@dimen/control_bar_margin_bottom"
145        app:columns="5"
146        app:enableOverflow="true"
147        app:layout_constraintBottom_toBottomOf="parent"
148        app:layout_constraintStart_toStartOf="parent"
149        app:layout_constraintEnd_toEndOf="parent"/>
150</androidx.constraintlayout.widget.ConstraintLayout>
151