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