blob: 07bbb8f40eb8c2d83a0b098da6c8fc65bdc70d0f [file] [log] [blame]
Beth Thibodeau07d20c32019-10-16 13:45:56 -04001<?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 -->
Selim Cinek2de5ebb2020-05-20 15:39:03 -070019<com.android.systemui.util.animation.TransitionLayout xmlns:android="http://schemas.android.com/apk/res/android"
Selim Cinekd8357922020-04-10 15:06:53 -070020 xmlns:app="http://schemas.android.com/apk/res-auto"
Beth Thibodeau07d20c32019-10-16 13:45:56 -040021 android:id="@+id/qs_media_controls"
22 android:layout_width="match_parent"
Selim Cinekd8357922020-04-10 15:06:53 -070023 android:layout_height="wrap_content"
Selim Cinekf0f74952020-04-21 11:45:16 -070024 android:clipChildren="false"
25 android:clipToPadding="false"
Selim Cinekd8357922020-04-10 15:06:53 -070026 android:gravity="center_horizontal|fill_vertical"
Selim Cinek2de5ebb2020-05-20 15:39:03 -070027 android:background="@drawable/qs_media_background">
Selim Cinekf0f74952020-04-21 11:45:16 -070028
Jeff DeCewafec78f2020-06-12 13:57:23 -040029 <!-- As per Material Design on Biderectionality, this is forced to LTR in code -->
Selim Cinekd8357922020-04-10 15:06:53 -070030 <FrameLayout
31 android:id="@+id/notification_media_progress_time"
32 android:layout_width="0dp"
33 android:layout_height="wrap_content"
34 android:forceHasOverlappingRendering="false">
35 <!-- width is set to "match_parent" to avoid extra layout calls -->
36 <TextView
37 android:id="@+id/media_elapsed_time"
38 android:layout_width="match_parent"
39 android:layout_height="wrap_content"
Jeff DeCewafec78f2020-06-12 13:57:23 -040040 android:layout_alignParentStart="true"
Selim Cinekd8357922020-04-10 15:06:53 -070041 android:fontFamily="@*android:string/config_bodyFontFamily"
Lucas Dupin81e9beb2020-05-14 19:28:36 -070042 android:textColor="@color/media_primary_text"
Robert Snoeberger77d3dca2020-06-02 17:36:49 -040043 android:gravity="start"
Selim Cinekd8357922020-04-10 15:06:53 -070044 android:textSize="14sp" />
45
46 <TextView
47 android:id="@+id/media_total_time"
48 android:layout_width="match_parent"
49 android:layout_height="wrap_content"
Jeff DeCewafec78f2020-06-12 13:57:23 -040050 android:layout_alignParentEnd="true"
Selim Cinekd8357922020-04-10 15:06:53 -070051 android:fontFamily="@*android:string/config_bodyFontFamily"
Lucas Dupin81e9beb2020-05-14 19:28:36 -070052 android:textColor="@color/media_primary_text"
Robert Snoeberger77d3dca2020-06-02 17:36:49 -040053 android:gravity="end"
Selim Cinekd8357922020-04-10 15:06:53 -070054 android:textSize="14sp" />
55 </FrameLayout>
56
Jeff DeCewafec78f2020-06-12 13:57:23 -040057 <!-- Actions must be ordered left-to-right even in RTL layout. However, they appear in a chain
58 with the album art and the title, and must as a group appear at the end of that chain. This is
59 accomplished by having the guidebox (an invisible view that is positioned around all 5 actions)
60 in the chain with the album art and the title. The actions are in a LTR chain bounded by that
61 guidebox, and the ambiguity of how wide the guidebox should be is resolved by using a barrier
62 which forces it's starting edge to be as far to the end as possible while fitting the actions.
63 -->
64 <androidx.constraintlayout.widget.Barrier
65 android:id="@+id/media_action_barrier"
66 android:layout_width="0dp"
67 android:layout_height="0dp"
68 android:orientation="vertical"
69 app:barrierDirection="start"
70 />
71
72 <View
73 android:id="@+id/media_action_guidebox"
74 android:layout_width="0dp"
75 android:layout_height="48dp"
76 android:layout_marginTop="16dp"
77 android:visibility="invisible"
78 />
79
Selim Cinekd8357922020-04-10 15:06:53 -070080 <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"
Fabian Kozynski349967a2020-06-22 12:18:06 -0400121 android:foreground="@drawable/qs_media_seamless_background"
Lucas Dupin5feeaca2020-05-28 11:01:54 -0700122 android:background="@drawable/qs_media_light_source"
Selim Cinekd8357922020-04-10 15:06:53 -0700123 android:orientation="horizontal"
124 android:forceHasOverlappingRendering="false"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400125 android:paddingStart="12dp"
Selim Cinekd8357922020-04-10 15:06:53 -0700126 android:paddingTop="6dp"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400127 android:paddingEnd="12dp"
Selim Cinekd8357922020-04-10 15:06:53 -0700128 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"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400134 android:layout_marginEnd="8dp"
Lucas Dupin81e9beb2020-05-14 19:28:36 -0700135 android:tint="@color/media_primary_text"
Selim Cinekd8357922020-04-10 15:06:53 -0700136 android:src="@*android:drawable/ic_media_seamless" />
137
138 <TextView
139 android:id="@+id/media_seamless_text"
140 android:layout_width="wrap_content"
141 android:layout_height="wrap_content"
Fabian Kozynskied9f3052020-06-22 17:11:03 -0400142 android:fontFamily="@*android:string/config_headlineFontFamily"
Selim Cinekd8357922020-04-10 15:06:53 -0700143 android:singleLine="true"
144 android:text="@*android:string/ext_media_seamless_action"
Lucas Dupin81e9beb2020-05-14 19:28:36 -0700145 android:textColor="@color/media_primary_text"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400146 android:textDirection="locale"
Selim Cinekd8357922020-04-10 15:06:53 -0700147 android:textSize="14sp" />
148 </LinearLayout>
149
Robert Snoeberger07340432020-06-19 17:33:48 -0400150 <ImageView
151 android:id="@+id/media_seamless_fallback"
152 android:layout_width="@dimen/qs_seamless_icon_size"
153 android:layout_height="@dimen/qs_seamless_icon_size"
154 android:tint="@color/media_primary_text"
155 android:src="@drawable/ic_cast_connected"
156 android:forceHasOverlappingRendering="false" />
157
158 <androidx.constraintlayout.widget.Barrier
159 android:id="@+id/media_seamless_barrier"
160 android:layout_width="wrap_content"
161 android:layout_height="wrap_content"
162 app:barrierDirection="start"
163 app:constraint_referenced_ids="media_seamless,media_seamless_fallback"
164 app:barrierAllowsGoneWidgets="false"
165 />
166
Selim Cinekd8357922020-04-10 15:06:53 -0700167 <!-- Seek Bar -->
Jeff DeCewafec78f2020-06-12 13:57:23 -0400168 <!-- As per Material Design on Biderectionality, this is forced to LTR in code -->
Selim Cinekd8357922020-04-10 15:06:53 -0700169 <SeekBar
170 android:id="@+id/media_progress_bar"
171 style="@android:style/Widget.ProgressBar.Horizontal"
172 android:layout_width="0dp"
173 android:layout_height="wrap_content"
174 android:clickable="true"
Fabian Kozynski8a9516d2020-06-19 17:26:54 -0400175 android:maxHeight="@dimen/qs_media_enabled_seekbar_height"
Selim Cinekd8357922020-04-10 15:06:53 -0700176 android:paddingTop="16dp"
177 android:paddingBottom="16dp"
Lucas Dupin81e9beb2020-05-14 19:28:36 -0700178 android:thumbTint="@color/media_primary_text"
179 android:progressTint="@color/media_seekbar_progress"
180 android:progressBackgroundTint="@color/media_disabled"
Selim Cinekd8357922020-04-10 15:06:53 -0700181 android:splitTrack="false" />
182
183 <!-- App name -->
184 <TextView
185 android:id="@+id/app_name"
Lucas Dupin81e9beb2020-05-14 19:28:36 -0700186 android:textColor="@color/media_primary_text"
Selim Cinekd8357922020-04-10 15:06:53 -0700187 android:layout_width="0dp"
188 android:layout_height="wrap_content"
189 android:singleLine="true"
Fabian Kozynskied9f3052020-06-22 17:11:03 -0400190 android:fontFamily="@*android:string/config_headlineFontFamily"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400191 android:textDirection="locale"
Selim Cinekd8357922020-04-10 15:06:53 -0700192 android:textSize="14sp" />
193
194 <!-- Song name -->
195 <TextView
196 android:id="@+id/header_title"
197 android:layout_width="wrap_content"
198 android:layout_height="wrap_content"
199 android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
200 android:singleLine="true"
Lucas Dupin81e9beb2020-05-14 19:28:36 -0700201 android:textColor="@color/media_primary_text"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400202 android:textDirection="locale"
Fabian Kozynski399928f2020-06-19 15:41:45 -0400203 android:textSize="16sp" />
Selim Cinekd8357922020-04-10 15:06:53 -0700204
205 <!-- Artist name -->
206 <TextView
207 android:id="@+id/header_artist"
208 android:layout_width="wrap_content"
209 android:layout_height="wrap_content"
Fabian Kozynskied9f3052020-06-22 17:11:03 -0400210 android:fontFamily="@*android:string/config_headlineFontFamily"
Selim Cinekd8357922020-04-10 15:06:53 -0700211 android:singleLine="true"
Fabian Kozynski2828fc62020-06-19 15:56:58 -0400212 android:textColor="@color/media_secondary_text"
Jeff DeCewafec78f2020-06-12 13:57:23 -0400213 android:textDirection="locale"
Selim Cinekd8357922020-04-10 15:06:53 -0700214 android:textSize="14sp" />
215
216 <com.android.internal.widget.CachingIconView
217 android:id="@+id/icon"
Lucas Dupin81e9beb2020-05-14 19:28:36 -0700218 android:tint="@color/media_primary_text"
Fabian Kozynskied9f3052020-06-22 17:11:03 -0400219 android:layout_width="20dp"
220 android:layout_height="20dp" />
Beth Thibodeau07d20c32019-10-16 13:45:56 -0400221
Beth Thibodeau8ebf6ad2020-03-18 20:01:27 -0400222 <!-- Buttons to remove this view when no longer needed -->
223 <include
224 layout="@layout/qs_media_panel_options"
Selim Cinek2de5ebb2020-05-20 15:39:03 -0700225 android:visibility="gone" />
226</com.android.systemui.util.animation.TransitionLayout>