1<?xml version="1.0" encoding="utf-8"?>
2<!--
3  ~ Copyright (C) 2022 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<ConstraintSet
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:app="http://schemas.android.com/apk/res-auto">
20
21    <Constraint
22        android:id="@+id/album_art"
23        android:layout_width="match_parent"
24        android:layout_height="@dimen/qs_media_session_height_expanded"
25        app:layout_constraintStart_toStartOf="parent"
26        app:layout_constraintEnd_toEndOf="parent"
27        app:layout_constraintTop_toTopOf="parent"
28        app:layout_constraintBottom_toBottomOf="parent" />
29
30    <!-- Touch ripple must have the same constraint as the album art. -->
31    <Constraint
32        android:id="@+id/touch_ripple_view"
33        android:layout_width="match_parent"
34        android:layout_height="@dimen/qs_media_session_height_expanded"
35        app:layout_constraintStart_toStartOf="@+id/album_art"
36        app:layout_constraintEnd_toEndOf="@+id/album_art"
37        app:layout_constraintTop_toTopOf="@+id/album_art"
38        app:layout_constraintBottom_toBottomOf="@+id/album_art" />
39
40    <!-- Turbulence noise must have the same constraint as the album art. -->
41    <Constraint
42        android:id="@+id/turbulence_noise_view"
43        android:layout_width="match_parent"
44        android:layout_height="@dimen/qs_media_session_height_expanded"
45        app:layout_constraintStart_toStartOf="@+id/album_art"
46        app:layout_constraintEnd_toEndOf="@+id/album_art"
47        app:layout_constraintTop_toTopOf="@+id/album_art"
48        app:layout_constraintBottom_toBottomOf="@+id/album_art" />
49
50    <Constraint
51        android:id="@+id/header_title"
52        android:layout_width="wrap_content"
53        android:layout_height="wrap_content"
54        android:layout_marginStart="@dimen/qs_media_padding"
55        android:layout_marginEnd="@dimen/qs_media_padding"
56        app:layout_constraintEnd_toStartOf="@id/actionPlayPause"
57        app:layout_constrainedWidth="true"
58        app:layout_constraintStart_toStartOf="parent"
59        app:layout_constraintBottom_toTopOf="@id/header_artist"
60        app:layout_constraintHorizontal_bias="0" />
61
62    <Constraint
63        android:id="@+id/media_explicit_indicator"
64        android:layout_width="wrap_content"
65        android:layout_height="wrap_content"
66        android:layout_marginEnd="@dimen/qs_media_info_spacing"
67        android:layout_marginBottom="@dimen/qs_media_padding"
68        android:layout_marginTop="0dp"
69        app:layout_constraintStart_toStartOf="@id/header_title"
70        app:layout_constraintEnd_toStartOf="@id/header_artist"
71        app:layout_constraintTop_toTopOf="@id/header_artist"
72        app:layout_constraintBottom_toTopOf="@id/media_action_barrier_top"
73        app:layout_constraintHorizontal_bias="0"
74        app:layout_constraintHorizontal_chainStyle="packed"/>
75
76    <Constraint
77        android:id="@+id/header_artist"
78        android:layout_width="wrap_content"
79        android:layout_height="wrap_content"
80        android:layout_marginEnd="@dimen/qs_media_padding"
81        android:layout_marginBottom="@dimen/qs_media_padding"
82        android:layout_marginTop="0dp"
83        app:layout_constrainedWidth="true"
84        app:layout_constraintEnd_toStartOf="@id/actionPlayPause"
85        app:layout_constraintStart_toEndOf="@id/media_explicit_indicator"
86        app:layout_constraintBottom_toTopOf="@id/media_action_barrier_top"
87        app:layout_constraintVertical_bias="0" />
88
89    <Constraint
90        android:id="@+id/actionPlayPause"
91        android:layout_width="48dp"
92        android:layout_height="48dp"
93        android:layout_marginStart="@dimen/qs_media_padding"
94        android:layout_marginEnd="@dimen/qs_media_padding"
95        android:layout_marginBottom="@dimen/qs_media_padding"
96        app:layout_constraintEnd_toEndOf="parent"
97        app:layout_constraintBottom_toTopOf="@id/media_action_barrier_top" />
98
99    <!--
100    The bottom row of action buttons should remain in the same order when RTL, so their constraints
101    are set with right/left instead of start/end.
102    The chain is set to "spread" so that the progress bar can be weighted to fill any empty space.
103     -->
104    <Constraint
105        android:id="@+id/actionPrev"
106        android:layout_width="48dp"
107        android:layout_height="48dp"
108        app:layout_constraintLeft_toLeftOf="parent"
109        app:layout_constraintBottom_toBottomOf="parent"
110        app:layout_constraintHorizontal_chainStyle="spread" />
111
112    <Constraint
113        android:id="@+id/media_scrubbing_elapsed_time"
114        android:layout_width="48dp"
115        android:layout_height="48dp"
116        app:layout_constraintLeft_toRightOf="@id/actionPrev"
117        app:layout_constraintBottom_toBottomOf="parent"
118        app:layout_constraintHorizontal_chainStyle="spread" />
119
120    <Constraint
121        android:id="@+id/media_progress_bar"
122        android:layout_width="0dp"
123        android:layout_height="48dp"
124        app:layout_constraintLeft_toRightOf="@id/media_scrubbing_elapsed_time"
125        app:layout_constraintRight_toLeftOf="@id/actionNext"
126        app:layout_constraintBottom_toBottomOf="parent"
127        app:layout_constraintHorizontal_weight="1" />
128
129    <Constraint
130        android:id="@+id/actionNext"
131        android:layout_width="48dp"
132        android:layout_height="48dp"
133        app:layout_constraintRight_toLeftOf="@id/media_scrubbing_total_time"
134        app:layout_constraintBottom_toBottomOf="parent" />
135
136    <Constraint
137        android:id="@+id/media_scrubbing_total_time"
138        android:layout_width="48dp"
139        android:layout_height="48dp"
140        app:layout_constraintRight_toLeftOf="@id/action0"
141        app:layout_constraintBottom_toBottomOf="parent" />
142
143    <Constraint
144        android:id="@+id/action0"
145        android:layout_width="48dp"
146        android:layout_height="48dp"
147        app:layout_constraintRight_toLeftOf="@id/action1"
148        app:layout_constraintBottom_toBottomOf="parent" />
149
150    <Constraint
151        android:id="@+id/action1"
152        android:layout_width="48dp"
153        android:layout_height="48dp"
154        app:layout_constraintRight_toLeftOf="@id/action2"
155        app:layout_constraintBottom_toBottomOf="parent" />
156
157    <Constraint
158        android:id="@+id/action2"
159        android:layout_width="48dp"
160        android:layout_height="48dp"
161        app:layout_constraintRight_toLeftOf="@id/action3"
162        app:layout_constraintBottom_toBottomOf="parent" />
163
164    <Constraint
165        android:id="@+id/action3"
166        android:layout_width="48dp"
167        android:layout_height="48dp"
168        app:layout_constraintRight_toLeftOf="@id/action4"
169        app:layout_constraintBottom_toBottomOf="parent" />
170
171    <Constraint
172        android:id="@+id/action4"
173        android:layout_width="48dp"
174        android:layout_height="48dp"
175        app:layout_constraintRight_toRightOf="parent"
176        app:layout_constraintBottom_toBottomOf="parent" />
177</ConstraintSet>
178