• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/media_action_barrier_start"
23        android:layout_width="0dp"
24        android:layout_height="0dp"
25        app:layout_constraintTop_toBottomOf="@id/media_seamless"
26        app:layout_constraintStart_toEndOf="@id/action_button_guideline" />
27
28    <Constraint
29        android:id="@+id/album_art"
30        android:layout_width="match_parent"
31        android:layout_height="@dimen/qs_media_session_height_collapsed"
32        app:layout_constraintStart_toStartOf="parent"
33        app:layout_constraintEnd_toEndOf="parent"
34        app:layout_constraintTop_toTopOf="parent"
35        app:layout_constraintBottom_toBottomOf="parent" />
36
37    <!-- Touch ripple must have the same constraint as the album art. -->
38    <Constraint
39        android:id="@+id/touch_ripple_view"
40        android:layout_width="match_parent"
41        android:layout_height="@dimen/qs_media_session_height_collapsed"
42        app:layout_constraintStart_toStartOf="@+id/album_art"
43        app:layout_constraintEnd_toEndOf="@+id/album_art"
44        app:layout_constraintTop_toTopOf="@+id/album_art"
45        app:layout_constraintBottom_toBottomOf="@+id/album_art" />
46
47    <!-- Turbulence noise must have the same constraint as the album art. -->
48    <Constraint
49        android:id="@+id/turbulence_noise_view"
50        android:layout_width="match_parent"
51        android:layout_height="@dimen/qs_media_session_height_collapsed"
52        app:layout_constraintStart_toStartOf="@+id/album_art"
53        app:layout_constraintEnd_toEndOf="@+id/album_art"
54        app:layout_constraintTop_toTopOf="@+id/album_art"
55        app:layout_constraintBottom_toBottomOf="@+id/album_art" />
56
57    <Constraint
58        android:id="@+id/header_title"
59        android:layout_width="wrap_content"
60        android:layout_height="wrap_content"
61        android:layout_marginTop="20dp"
62        android:layout_marginStart="@dimen/qs_media_padding"
63        android:layout_marginEnd="@dimen/qs_media_padding"
64        app:layout_constraintEnd_toStartOf="@id/action_button_guideline"
65        app:layout_constrainedWidth="true"
66        app:layout_constraintTop_toBottomOf="@id/icon"
67        app:layout_constraintStart_toStartOf="parent"
68        app:layout_constraintHorizontal_bias="0" />
69
70    <Constraint
71        android:id="@+id/media_explicit_indicator"
72        android:layout_width="wrap_content"
73        android:layout_height="wrap_content"
74        android:layout_marginEnd="@dimen/qs_media_info_spacing"
75        android:layout_marginBottom="@dimen/qs_media_padding"
76        android:layout_marginTop="@dimen/qs_media_icon_offset"
77        app:layout_constraintStart_toStartOf="@id/header_title"
78        app:layout_constraintEnd_toStartOf="@id/header_artist"
79        app:layout_constraintTop_toTopOf="@id/header_artist"
80        app:layout_constraintBottom_toBottomOf="@id/header_artist"
81        app:layout_constraintVertical_bias="0"
82        app:layout_constraintHorizontal_bias="0"
83        app:layout_constraintHorizontal_chainStyle="packed" />
84
85    <Constraint
86        android:id="@+id/header_artist"
87        android:layout_width="wrap_content"
88        android:layout_height="wrap_content"
89        android:layout_marginEnd="@dimen/qs_media_padding"
90        android:layout_marginTop="0dp"
91        app:layout_constraintEnd_toStartOf="@id/action_button_guideline"
92        app:layout_constrainedWidth="true"
93        app:layout_constraintTop_toBottomOf="@id/header_title"
94        app:layout_constraintStart_toEndOf="@id/media_explicit_indicator"
95        app:layout_constraintVertical_bias="0" />
96
97    <Constraint
98        android:id="@+id/actionPlayPause"
99        android:layout_width="48dp"
100        android:layout_height="48dp"
101        android:layout_marginEnd="@dimen/qs_media_padding"
102        android:layout_marginBottom="@dimen/qs_media_padding"
103        app:layout_constraintVertical_bias="1"
104        app:layout_constraintEnd_toEndOf="parent"
105        app:layout_constraintBottom_toBottomOf="parent"
106        app:layout_constraintTop_toBottomOf="@id/media_seamless"
107        app:layout_constraintStart_toEndOf="@id/media_action_barrier_end" />
108
109    <!--
110    There will only be 3 action buttons shown at most in this layout (controlled in code).
111    Play/Pause should always be at the end, but the other buttons should remain in the same order
112    when in RTL.
113    This is accomplished by setting two barriers at the start and end of the small buttons,
114    anchored to a guideline set at 3x button width from the end. The text and play/pause button are
115    positioned relative to the barriers, and the small buttons use right/left constraints to stay
116    in the correct order inside the barriers.
117    -->
118    <Constraint
119        android:id="@+id/actionPrev"
120        android:layout_width="48dp"
121        android:layout_height="48dp"
122        android:layout_marginBottom="@dimen/qs_media_padding"
123        app:layout_constraintHorizontal_bias="1"
124        app:layout_constraintVertical_bias="1"
125        app:layout_constraintHorizontal_chainStyle="packed"
126        app:layout_constraintRight_toLeftOf="@id/media_progress_bar"
127        app:layout_constraintBottom_toBottomOf="parent"
128        app:layout_constraintTop_toBottomOf="@id/media_seamless"
129        app:layout_constraintLeft_toRightOf="@id/media_action_barrier_start" />
130
131    <!-- Showing time while scrubbing isn't available in collapsed mode. -->
132    <Constraint
133        android:id="@+id/media_scrubbing_elapsed_time"
134        android:visibility="gone"
135        app:layout_constraintRight_toLeftOf="@id/media_progress_bar"
136        app:layout_constraintBottom_toBottomOf="parent"
137        app:layout_constraintTop_toBottomOf="@id/media_seamless"
138        app:layout_constraintLeft_toRightOf="@id/media_action_barrier_start" />
139
140    <Constraint
141        android:id="@+id/media_progress_bar"
142        android:layout_width="0dp"
143        android:layout_height="wrap_content"
144        android:layout_marginBottom="@dimen/qs_media_padding"
145        android:visibility="gone"
146        app:layout_constraintVertical_bias="1"
147        app:layout_constraintLeft_toRightOf="@id/actionPrev"
148        app:layout_constraintRight_toLeftOf="@id/actionNext"
149        app:layout_constraintBottom_toBottomOf="parent"
150        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
151
152    <Constraint
153        android:id="@+id/actionNext"
154        android:layout_width="48dp"
155        android:layout_height="48dp"
156        android:layout_marginBottom="@dimen/qs_media_padding"
157        app:layout_constraintVertical_bias="1"
158        app:layout_constraintLeft_toRightOf="@id/media_progress_bar"
159        app:layout_constraintRight_toLeftOf="@id/action0"
160        app:layout_constraintBottom_toBottomOf="parent"
161        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
162
163    <!-- Showing time while scrubbing isn't available in collapsed mode. -->
164    <Constraint
165        android:id="@+id/media_scrubbing_total_time"
166        android:visibility="gone"
167        app:layout_constraintVertical_bias="1"
168        app:layout_constraintLeft_toRightOf="@id/media_progress_bar"
169        app:layout_constraintRight_toLeftOf="@id/action0"
170        app:layout_constraintBottom_toBottomOf="parent"
171        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
172
173    <Constraint
174        android:id="@+id/action0"
175        android:layout_width="48dp"
176        android:layout_height="48dp"
177        android:layout_marginBottom="@dimen/qs_media_padding"
178        android:visibility="gone"
179        app:layout_constraintVertical_bias="1"
180        app:layout_constraintLeft_toRightOf="@id/actionNext"
181        app:layout_constraintRight_toLeftOf="@id/action1"
182        app:layout_constraintBottom_toBottomOf="parent"
183        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
184
185    <Constraint
186        android:id="@+id/action1"
187        android:layout_width="48dp"
188        android:layout_height="48dp"
189        android:layout_marginBottom="@dimen/qs_media_padding"
190        android:visibility="gone"
191        app:layout_constraintVertical_bias="1"
192        app:layout_constraintLeft_toRightOf="@id/action0"
193        app:layout_constraintRight_toLeftOf="@id/action2"
194        app:layout_constraintBottom_toBottomOf="parent"
195        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
196
197    <Constraint
198        android:id="@+id/action2"
199        android:layout_width="48dp"
200        android:layout_height="48dp"
201        android:layout_marginBottom="@dimen/qs_media_padding"
202        android:visibility="gone"
203        app:layout_constraintVertical_bias="1"
204        app:layout_constraintLeft_toRightOf="@id/action1"
205        app:layout_constraintRight_toLeftOf="@id/action3"
206        app:layout_constraintBottom_toBottomOf="parent"
207        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
208
209    <Constraint
210        android:id="@+id/action3"
211        android:layout_width="48dp"
212        android:layout_height="48dp"
213        android:layout_marginBottom="@dimen/qs_media_padding"
214        android:visibility="gone"
215        app:layout_constraintVertical_bias="1"
216        app:layout_constraintLeft_toRightOf="@id/action2"
217        app:layout_constraintRight_toLeftOf="@id/action4"
218        app:layout_constraintBottom_toBottomOf="parent"
219        app:layout_constraintTop_toBottomOf="@id/media_seamless" />
220
221    <Constraint
222        android:id="@+id/action4"
223        android:layout_width="48dp"
224        android:layout_height="48dp"
225        android:layout_marginBottom="@dimen/qs_media_padding"
226        android:visibility="gone"
227        app:layout_constraintVertical_bias="1"
228        app:layout_constraintLeft_toRightOf="@id/action3"
229        app:layout_constraintBottom_toBottomOf="parent"
230        app:layout_constraintTop_toBottomOf="@id/media_seamless"
231        app:layout_constraintRight_toLeftOf="@id/media_action_barrier_end" />
232</ConstraintSet>
233