1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2019 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 18<!-- Layout for media controls inside QSPanel carousel --> 19<com.android.systemui.util.animation.TransitionLayout xmlns:android="http://schemas.android.com/apk/res/android" 20 xmlns:app="http://schemas.android.com/apk/res-auto" 21 android:id="@+id/qs_media_controls" 22 android:layout_width="match_parent" 23 android:layout_height="wrap_content" 24 android:clipChildren="false" 25 android:clipToPadding="false" 26 android:gravity="center_horizontal|fill_vertical" 27 android:forceHasOverlappingRendering="false" 28 android:background="@drawable/qs_media_background"> 29 30 <androidx.constraintlayout.widget.Guideline 31 android:id="@+id/center_vertical_guideline" 32 android:layout_width="wrap_content" 33 android:layout_height="wrap_content" 34 android:orientation="vertical" 35 app:layout_constraintGuide_percent="0.5" 36 /> 37 38 <!-- As per Material Design on Biderectionality, this is forced to LTR in code --> 39 <FrameLayout 40 android:id="@+id/notification_media_progress_time" 41 android:layout_width="0dp" 42 android:layout_height="wrap_content" 43 android:forceHasOverlappingRendering="false"> 44 <!-- width is set to "match_parent" to avoid extra layout calls --> 45 <TextView 46 android:id="@+id/media_elapsed_time" 47 android:layout_width="match_parent" 48 android:layout_height="wrap_content" 49 android:layout_alignParentStart="true" 50 android:fontFamily="@*android:string/config_bodyFontFamily" 51 android:textColor="@color/media_primary_text" 52 android:gravity="start" 53 android:textSize="14sp" /> 54 55 <TextView 56 android:id="@+id/media_total_time" 57 android:layout_width="match_parent" 58 android:layout_height="wrap_content" 59 android:layout_alignParentEnd="true" 60 android:fontFamily="@*android:string/config_bodyFontFamily" 61 android:textColor="@color/media_primary_text" 62 android:gravity="end" 63 android:textSize="14sp" /> 64 </FrameLayout> 65 66 <!-- Actions must be ordered left-to-right even in RTL layout. However, they appear in a chain 67 with the album art and the title, and must as a group appear at the end of that chain. This is 68 accomplished by having all actions appear in a LTR chain within the parent, and then biasing it 69 to the right side, then this barrier is used to bound the text views. --> 70 <androidx.constraintlayout.widget.Barrier 71 android:id="@+id/media_action_barrier" 72 android:layout_width="0dp" 73 android:layout_height="0dp" 74 android:orientation="vertical" 75 app:layout_constraintTop_toTopOf="parent" 76 app:barrierDirection="start" 77 app:constraint_referenced_ids="action0,action1,action2,action3,action4" 78 /> 79 80 <ImageButton 81 android:id="@+id/action0" 82 style="@style/MediaPlayer.Button" 83 android:layout_width="48dp" 84 android:layout_height="48dp" /> 85 86 <ImageButton 87 android:id="@+id/action1" 88 style="@style/MediaPlayer.Button" 89 android:layout_width="48dp" 90 android:layout_height="48dp" /> 91 92 <ImageButton 93 android:id="@+id/action2" 94 style="@style/MediaPlayer.Button" 95 android:layout_width="52dp" 96 android:layout_height="52dp" /> 97 98 <ImageButton 99 android:id="@+id/action3" 100 style="@style/MediaPlayer.Button" 101 android:layout_width="48dp" 102 android:layout_height="48dp" /> 103 104 <ImageButton 105 android:id="@+id/action4" 106 style="@style/MediaPlayer.Button" 107 android:layout_width="48dp" 108 android:layout_height="48dp" /> 109 110 <!-- Album Art --> 111 <ImageView 112 android:id="@+id/album_art" 113 android:layout_width="@dimen/qs_media_album_size" 114 android:layout_height="@dimen/qs_media_album_size" /> 115 116 <!-- Seamless Output Switcher --> 117 <LinearLayout 118 android:id="@+id/media_seamless" 119 android:layout_width="0dp" 120 android:layout_height="wrap_content" 121 android:foreground="@drawable/qs_media_seamless_background" 122 android:background="@drawable/qs_media_light_source" 123 android:orientation="horizontal" 124 android:forceHasOverlappingRendering="false" 125 android:paddingStart="12dp" 126 android:paddingTop="6dp" 127 android:paddingEnd="12dp" 128 android:paddingBottom="6dp"> 129 130 <ImageView 131 android:id="@+id/media_seamless_image" 132 android:layout_width="@dimen/qs_seamless_icon_size" 133 android:layout_height="@dimen/qs_seamless_icon_size" 134 android:layout_marginEnd="8dp" 135 android:layout_gravity="center_vertical" 136 android:tint="@color/media_primary_text" 137 android:src="@*android:drawable/ic_media_seamless" /> 138 139 <TextView 140 android:id="@+id/media_seamless_text" 141 android:layout_width="wrap_content" 142 android:layout_height="wrap_content" 143 android:layout_gravity="center_vertical" 144 android:fontFamily="@*android:string/config_headlineFontFamily" 145 android:singleLine="true" 146 android:text="@*android:string/ext_media_seamless_action" 147 android:textColor="@color/media_primary_text" 148 android:textDirection="locale" 149 android:textSize="14sp" /> 150 </LinearLayout> 151 152 <ImageView 153 android:id="@+id/media_seamless_fallback" 154 android:layout_width="@dimen/qs_seamless_icon_size" 155 android:layout_height="@dimen/qs_seamless_icon_size" 156 android:tint="@color/media_primary_text" 157 android:src="@drawable/ic_cast_connected" 158 android:forceHasOverlappingRendering="false" /> 159 160 <!-- Seek Bar --> 161 <!-- As per Material Design on Biderectionality, this is forced to LTR in code --> 162 <SeekBar 163 android:id="@+id/media_progress_bar" 164 style="@android:style/Widget.ProgressBar.Horizontal" 165 android:layout_width="0dp" 166 android:layout_height="wrap_content" 167 android:clickable="true" 168 android:maxHeight="@dimen/qs_media_enabled_seekbar_height" 169 android:paddingTop="16dp" 170 android:paddingBottom="16dp" 171 android:thumbTint="@color/media_primary_text" 172 android:progressTint="@color/media_seekbar_progress" 173 android:progressBackgroundTint="@color/media_disabled" 174 android:splitTrack="false" /> 175 176 <!-- App name --> 177 <TextView 178 android:id="@+id/app_name" 179 android:textColor="@color/media_primary_text" 180 android:layout_width="0dp" 181 android:layout_height="wrap_content" 182 android:singleLine="true" 183 android:fontFamily="@*android:string/config_headlineFontFamily" 184 android:textDirection="locale" 185 android:textSize="14sp" /> 186 187 <!-- Song name --> 188 <TextView 189 android:id="@+id/header_title" 190 android:layout_width="wrap_content" 191 android:layout_height="wrap_content" 192 android:fontFamily="@*android:string/config_headlineFontFamilyMedium" 193 android:singleLine="true" 194 android:textColor="@color/media_primary_text" 195 android:textSize="16sp" /> 196 197 <!-- Artist name --> 198 <TextView 199 android:id="@+id/header_artist" 200 android:layout_width="wrap_content" 201 android:layout_height="wrap_content" 202 android:fontFamily="@*android:string/config_headlineFontFamily" 203 android:singleLine="true" 204 android:textColor="@color/media_secondary_text" 205 android:textSize="14sp" /> 206 207 <com.android.internal.widget.CachingIconView 208 android:id="@+id/icon" 209 android:tint="@color/media_primary_text" 210 android:layout_width="@dimen/qs_media_icon_size" 211 android:layout_height="@dimen/qs_media_icon_size" /> 212 213 <!-- Buttons to remove this view when no longer needed --> 214 <include 215 layout="@layout/qs_media_panel_options" 216 android:visibility="gone" /> 217</com.android.systemui.util.animation.TransitionLayout> 218