Updated layout for more compact player
- App icon is now on the corner of album art - Small player is condensed, with smaller art - No album art will instead show a fallback view with device icon - Device name shows in output switcher - Adjusted colors and dimens to match spec - Fixed bug where too many compact actions could be shown Test: visual Test: atest com.android.systemui.media Bug: 176177555 Bug: 182292357 Change-Id: I56ec5c5f1188f7547b6e74a2f9bf8d1ad2ee21e4
This commit is contained in:
20
packages/SystemUI/res/drawable/qs_media_art_background.xml
Normal file
20
packages/SystemUI/res/drawable/qs_media_art_background.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<corners android:radius="@dimen/qs_media_album_radius"/>
|
||||
</shape>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:color="?androidprv:attr/colorAccentPrimaryVariant"
|
||||
android:width="1dp"/>
|
||||
<corners android:radius="24dp"/>
|
||||
<padding
|
||||
android:left="16dp"
|
||||
android:right="16dp"
|
||||
android:top="8dp"
|
||||
android:bottom="8dp" />
|
||||
</shape>
|
||||
23
packages/SystemUI/res/drawable/qs_media_icon_background.xml
Normal file
23
packages/SystemUI/res/drawable/qs_media_icon_background.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
~ Copyright (C) 2021 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License
|
||||
-->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<solid android:color="?android:attr/colorBackground" />
|
||||
<size
|
||||
android:width="20dp"
|
||||
android:height="20dp" />
|
||||
</shape>
|
||||
@@ -20,6 +20,11 @@
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/media_seamless_border" />
|
||||
<corners android:radius="24dp"/>
|
||||
<padding
|
||||
android:left="8dp"
|
||||
android:right="8dp"
|
||||
android:top="4dp"
|
||||
android:bottom="4dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
||||
@@ -89,30 +89,18 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:id="@+id/recommendation_text"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:text="@string/controls_media_title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/remove_text"
|
||||
app:layout_constraintVertical_chainStyle="spread_inside"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:id="@+id/remove_text"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/controls_media_close_session"
|
||||
app:layout_constraintTop_toBottomOf="@id/recommendation_text"
|
||||
android:gravity="center_horizontal|top"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/settings"/>
|
||||
|
||||
<FrameLayout
|
||||
@@ -120,8 +108,8 @@
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:paddingBottom="@dimen/qs_media_padding"
|
||||
android:minWidth="48dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -132,6 +120,7 @@
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_media_button_background"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/controls_media_settings_button" />
|
||||
@@ -142,8 +131,8 @@
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:paddingBottom="@dimen/qs_media_padding"
|
||||
android:minWidth="48dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -153,6 +142,7 @@
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_media_button_background"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/cancel" />
|
||||
@@ -163,8 +153,8 @@
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:paddingBottom="@dimen/qs_media_padding"
|
||||
android:minWidth="48dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -174,6 +164,7 @@
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_media_button_background"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/controls_media_dismiss_button"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
<!-- Layout for media controls inside QSPanel carousel -->
|
||||
<com.android.systemui.util.animation.TransitionLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
|
||||
android:id="@+id/qs_media_controls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -32,8 +33,14 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
/>
|
||||
app:layout_constraintGuide_percent="0.6" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/center_horizontal_guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<!-- As per Material Design on Biderectionality, this is forced to LTR in code -->
|
||||
<FrameLayout
|
||||
@@ -50,7 +57,7 @@
|
||||
android:fontFamily="@*android:string/config_bodyFontFamily"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:gravity="start"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="12sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/media_total_time"
|
||||
@@ -60,11 +67,11 @@
|
||||
android:fontFamily="@*android:string/config_bodyFontFamily"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:gravity="end"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="12sp" />
|
||||
</FrameLayout>
|
||||
|
||||
<!-- Actions must be ordered left-to-right even in RTL layout. However, they appear in a chain
|
||||
with the album art, and must as a group appear at the end of that chain. This is
|
||||
with the artist name, and must as a group appear at the end of that chain. This is
|
||||
accomplished by having all actions appear in a LTR chain within the parent, and then biasing it
|
||||
to the right side, then this barrier is used to bound the text views. -->
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
@@ -72,10 +79,10 @@
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_title"
|
||||
app:barrierDirection="start"
|
||||
app:constraint_referenced_ids="action0,action1,action2,action3,action4"
|
||||
app:layout_constraintHorizontal_bias="0" />
|
||||
/>
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action0"
|
||||
@@ -92,8 +99,8 @@
|
||||
<ImageButton
|
||||
android:id="@+id/action2"
|
||||
style="@style/MediaPlayer.Button"
|
||||
android:layout_width="52dp"
|
||||
android:layout_height="52dp" />
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action3"
|
||||
@@ -112,23 +119,27 @@
|
||||
android:id="@+id/album_art"
|
||||
android:layout_width="@dimen/qs_media_album_size"
|
||||
android:layout_height="@dimen/qs_media_album_size"
|
||||
android:layout_gravity="center_vertical" />
|
||||
android:layout_gravity="center_vertical"
|
||||
android:background="@drawable/qs_media_art_background"
|
||||
android:backgroundTint="?androidprv:attr/colorAccentSecondary"
|
||||
android:clipToOutline="true" />
|
||||
|
||||
<!-- Seamless Output Switcher -->
|
||||
<LinearLayout
|
||||
android:id="@+id/media_seamless"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:gravity="top|end"
|
||||
android:paddingTop="@dimen/qs_media_padding"
|
||||
android:paddingEnd="@dimen/qs_media_padding"
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:forceHasOverlappingRendering="false">
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/qs_seamless_height"
|
||||
android:background="@drawable/qs_media_seamless_background"
|
||||
android:orientation="horizontal"
|
||||
android:padding="6dp"
|
||||
android:contentDescription="@string/quick_settings_media_device_label">
|
||||
<ImageView
|
||||
android:id="@+id/media_seamless_image"
|
||||
@@ -138,25 +149,28 @@
|
||||
android:tint="?android:attr/colorPrimary"
|
||||
android:src="@*android:drawable/ic_media_seamless" />
|
||||
<TextView
|
||||
android:visibility="gone"
|
||||
android:id="@+id/media_seamless_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
||||
android:singleLine="true"
|
||||
android:text="@*android:string/ext_media_seamless_action"
|
||||
android:textColor="?android:attr/colorPrimary"
|
||||
android:textDirection="locale"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/media_seamless_fallback"
|
||||
android:layout_width="@dimen/qs_seamless_icon_size"
|
||||
android:layout_height="@dimen/qs_seamless_icon_size"
|
||||
android:layout_width="@dimen/qs_seamless_fallback_icon_size"
|
||||
android:layout_height="@dimen/qs_seamless_fallback_icon_size"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_center_guideline_padding"
|
||||
android:layout_marginEnd="@dimen/qs_seamless_fallback_margin"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:src="@drawable/ic_cast_connected"
|
||||
android:forceHasOverlappingRendering="false" />
|
||||
@@ -170,27 +184,18 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:clickable="true"
|
||||
android:maxHeight="@dimen/qs_media_enabled_seekbar_height"
|
||||
android:paddingVertical="@dimen/qs_media_enabled_seekbar_vertical_padding"
|
||||
android:paddingTop="@dimen/qs_media_enabled_seekbar_vertical_padding"
|
||||
android:layout_marginTop="-22dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:thumbTint="?android:attr/textColorPrimary"
|
||||
android:progressTint="?android:attr/textColorPrimary"
|
||||
android:progressBackgroundTint="?android:attr/colorBackground"
|
||||
android:progressBackgroundTint="?android:attr/textColorTertiary"
|
||||
android:splitTrack="false" />
|
||||
|
||||
<!-- App name -->
|
||||
<TextView
|
||||
android:id="@+id/app_name"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
||||
android:textDirection="locale"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- Song name -->
|
||||
<TextView
|
||||
android:id="@+id/header_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:singleLine="true"
|
||||
@@ -200,7 +205,7 @@
|
||||
<!-- Artist name -->
|
||||
<TextView
|
||||
android:id="@+id/header_artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
||||
android:singleLine="true"
|
||||
@@ -209,39 +214,28 @@
|
||||
|
||||
<com.android.internal.widget.CachingIconView
|
||||
android:id="@+id/icon"
|
||||
android:tint="?android:attr/textColorPrimary"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_margin="6dp" />
|
||||
android:tint="?android:attr/colorAccent"
|
||||
android:layout_width="@dimen/qs_media_icon_size"
|
||||
android:layout_height="@dimen/qs_media_icon_size"
|
||||
android:background="@drawable/qs_media_icon_background"
|
||||
/>
|
||||
|
||||
<!-- Constraints are set here as they are the same regardless of host -->
|
||||
<!-- Long press menu -->
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:id="@+id/media_text"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:text="@string/controls_media_title"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/remove_text"
|
||||
app:layout_constraintVertical_chainStyle="spread_inside"/>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:id="@+id/remove_text"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamily"
|
||||
android:singleLine="true"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/controls_media_close_session"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_text"
|
||||
android:gravity="center_horizontal|top"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/settings"/>
|
||||
|
||||
<FrameLayout
|
||||
@@ -249,8 +243,8 @@
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:paddingBottom="@dimen/qs_media_padding"
|
||||
android:minWidth="48dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -261,6 +255,7 @@
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_media_button_background"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/controls_media_settings_button" />
|
||||
@@ -271,17 +266,19 @@
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:paddingBottom="@dimen/qs_media_padding"
|
||||
android:minWidth="48dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/dismiss" >
|
||||
app:layout_constraintEnd_toStartOf="@id/dismiss"
|
||||
app:layout_constraintTop_toBottomOf="@id/remove_text">
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_media_button_background"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/cancel" />
|
||||
@@ -292,17 +289,19 @@
|
||||
android:background="@drawable/qs_media_light_source"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:paddingBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:paddingBottom="@dimen/qs_media_padding"
|
||||
android:minWidth="48dp"
|
||||
android:minHeight="48dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/remove_text">
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/qs_media_button_background"
|
||||
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:text="@string/controls_media_dismiss_button"
|
||||
|
||||
@@ -1254,26 +1254,31 @@
|
||||
|
||||
<!-- Size of media cards in the QSPanel carousel -->
|
||||
<dimen name="qs_media_padding">16dp</dimen>
|
||||
<dimen name="qs_media_panel_outer_padding">16dp</dimen>
|
||||
<dimen name="qs_media_album_size">120dp</dimen>
|
||||
<dimen name="qs_media_album_size_small">72dp</dimen>
|
||||
<dimen name="qs_media_album_size">92dp</dimen>
|
||||
<dimen name="qs_media_album_radius">14dp</dimen>
|
||||
<dimen name="qs_media_icon_size">16dp</dimen>
|
||||
<dimen name="qs_media_album_device_padding">26dp</dimen>
|
||||
<dimen name="qs_media_info_margin">12dp</dimen>
|
||||
<dimen name="qs_media_info_spacing">4dp</dimen>
|
||||
<dimen name="qs_media_icon_size">20dp</dimen>
|
||||
<dimen name="qs_media_icon_offset">4dp</dimen>
|
||||
<dimen name="qs_center_guideline_padding">10dp</dimen>
|
||||
<dimen name="qs_seamless_icon_size">@dimen/qs_media_icon_size</dimen>
|
||||
<dimen name="qs_media_action_spacing">4dp</dimen>
|
||||
<dimen name="qs_media_action_top">8dp</dimen>
|
||||
<dimen name="qs_seamless_height">24dp</dimen>
|
||||
<dimen name="qs_seamless_icon_size">16dp</dimen>
|
||||
<dimen name="qs_seamless_fallback_icon_size">@dimen/qs_seamless_icon_size</dimen>
|
||||
<dimen name="qs_seamless_fallback_end_margin">16dp</dimen>
|
||||
<dimen name="qqs_media_spacing">16dp</dimen>
|
||||
<dimen name="qs_seamless_fallback_margin">20dp</dimen>
|
||||
<dimen name="qs_footer_horizontal_margin">22dp</dimen>
|
||||
<dimen name="qs_media_disabled_seekbar_height">1dp</dimen>
|
||||
<dimen name="qs_media_enabled_seekbar_height">3dp</dimen>
|
||||
<dimen name="qs_media_enabled_seekbar_vertical_padding">15dp</dimen>
|
||||
<dimen name="qs_media_disabled_seekbar_vertical_padding">16dp</dimen>
|
||||
<dimen name="qs_media_enabled_seekbar_height">2dp</dimen>
|
||||
<dimen name="qs_media_enabled_seekbar_vertical_padding">35dp</dimen>
|
||||
<dimen name="qs_media_disabled_seekbar_vertical_padding">36dp</dimen>
|
||||
|
||||
<!-- Size of Smartspace media recommendations cards in the QSPanel carousel -->
|
||||
<dimen name="qs_aa_media_rec_album_size">80dp</dimen>
|
||||
<dimen name="qs_aa_media_rec_icon_size">20dp</dimen>
|
||||
|
||||
|
||||
<!-- Window magnification -->
|
||||
<dimen name="magnification_border_drag_size">35dp</dimen>
|
||||
<dimen name="magnification_outer_border_margin">15dp</dimen>
|
||||
|
||||
@@ -2824,10 +2824,10 @@
|
||||
|
||||
<!-- Title for media controls [CHAR_LIMIT=50] -->
|
||||
<string name="controls_media_title">Media</string>
|
||||
<!-- Explanation for closing controls associated with a specific media session [CHAR_LIMIT=NONE] -->
|
||||
<string name="controls_media_close_session">Hide the current session.</string>
|
||||
<!-- Explanation that controls associated with a specific media session are active [CHAR_LIMIT=NONE] -->
|
||||
<string name="controls_media_active_session">Current session cannot be hidden.</string>
|
||||
<!-- Explanation for closing controls associated with a specific media session [CHAR_LIMIT=50] -->
|
||||
<string name="controls_media_close_session">Hide this media session?</string>
|
||||
<!-- Explanation that controls associated with a specific media session are active [CHAR_LIMIT=50] -->
|
||||
<string name="controls_media_active_session">The current media session cannot be hidden.</string>
|
||||
<!-- Label for a button that will hide media controls [CHAR_LIMIT=30] -->
|
||||
<string name="controls_media_dismiss_button">Dismiss</string>
|
||||
<!-- Label for button to resume media playback [CHAR_LIMIT=NONE] -->
|
||||
|
||||
@@ -21,96 +21,82 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="@dimen/qs_media_icon_size"
|
||||
android:layout_height="@dimen/qs_media_icon_size"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/album_art"
|
||||
/>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_center_guideline_padding"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintTop_toTopOf="@id/icon"
|
||||
app:layout_constraintBottom_toBottomOf="@id/icon"
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_vertical_guideline"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
android:translationY="@dimen/qs_media_icon_offset"
|
||||
android:translationX="@dimen/qs_media_icon_offset"
|
||||
app:layout_constraintEnd_toEndOf="@id/album_art"
|
||||
app:layout_constraintBottom_toBottomOf="@id/album_art"
|
||||
/>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/media_seamless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/center_vertical_guideline"
|
||||
app:layout_constraintBottom_toTopOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintHorizontal_chainStyle="spread_inside"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintWidth_min="48dp"
|
||||
app:layout_constraintHeight_min="48dp"
|
||||
android:paddingTop="@dimen/qs_media_padding"
|
||||
android:paddingEnd="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_center_guideline_padding"
|
||||
android:layout_marginBottom="4dp"
|
||||
/>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/media_seamless_fallback"
|
||||
android:layout_width="@dimen/qs_seamless_fallback_icon_size"
|
||||
android:layout_height="@dimen/qs_seamless_fallback_icon_size"
|
||||
android:layout_marginEnd="@dimen/qs_seamless_fallback_end_margin"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_center_guideline_padding"
|
||||
android:layout_marginEnd="@dimen/qs_seamless_fallback_margin"
|
||||
android:alpha="0.5"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintTop_toTopOf="@id/icon"
|
||||
app:layout_constraintBottom_toBottomOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintStart_toEndOf="@id/center_vertical_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/album_art"
|
||||
android:layout_width="@dimen/qs_media_album_size"
|
||||
android:layout_height="@dimen/qs_media_album_size"
|
||||
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_width="@dimen/qs_media_album_size_small"
|
||||
android:layout_height="@dimen/qs_media_album_size_small"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/media_action_barrier"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
/>
|
||||
|
||||
<!-- Song name -->
|
||||
<Constraint
|
||||
android:id="@+id/header_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/qqs_media_spacing"
|
||||
android:layout_marginStart="@dimen/qqs_media_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_info_margin"
|
||||
android:layout_marginEnd="@dimen/qs_center_guideline_padding"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintTop_toBottomOf="@id/icon"
|
||||
app:layout_constraintBottom_toTopOf="@id/header_artist"
|
||||
app:layout_constraintBottom_toTopOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintStart_toEndOf="@id/album_art"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_vertical_guideline"
|
||||
app:layout_constraintHorizontal_bias="0"/>
|
||||
|
||||
<!-- Artist name -->
|
||||
<Constraint
|
||||
android:id="@+id/header_artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginBottom="@dimen/qqs_media_spacing"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_title"
|
||||
android:layout_marginTop="@dimen/qs_media_info_spacing"
|
||||
app:layout_constraintTop_toTopOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintStart_toStartOf="@id/header_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@id/media_action_barrier"
|
||||
app:layout_constraintHorizontal_bias="0"/>
|
||||
|
||||
<!-- Seek Bar -->
|
||||
@@ -130,9 +116,6 @@
|
||||
android:alpha="0.0"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="35dp"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/album_art"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -143,15 +126,16 @@
|
||||
android:id="@+id/action0"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="@dimen/qqs_media_spacing"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginTop="@dimen/qs_media_action_spacing"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
app:layout_constraintTop_toBottomOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/action1"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
>
|
||||
</Constraint>
|
||||
|
||||
@@ -159,10 +143,10 @@
|
||||
android:id="@+id/action1"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginTop="@dimen/qs_media_action_spacing"
|
||||
app:layout_constraintTop_toBottomOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/action0"
|
||||
app:layout_constraintRight_toLeftOf="@id/action2"
|
||||
@@ -173,10 +157,10 @@
|
||||
android:id="@+id/action2"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginTop="@dimen/qs_media_action_spacing"
|
||||
app:layout_constraintTop_toBottomOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/action1"
|
||||
app:layout_constraintRight_toLeftOf="@id/action3"
|
||||
@@ -187,10 +171,10 @@
|
||||
android:id="@+id/action3"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginTop="@dimen/qs_media_action_spacing"
|
||||
app:layout_constraintTop_toBottomOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/action2"
|
||||
app:layout_constraintRight_toLeftOf="@id/action4"
|
||||
@@ -201,12 +185,12 @@
|
||||
android:id="@+id/action4"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:visibility="gone"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_action_spacing"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
app:layout_constraintTop_toBottomOf="@id/center_horizontal_guideline"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/action3"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
@@ -21,30 +21,16 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="@dimen/qs_media_icon_size"
|
||||
android:layout_height="@dimen/qs_media_icon_size"
|
||||
android:layout_marginStart="18dp"
|
||||
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/album_art"
|
||||
/>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/app_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_center_guideline_padding"
|
||||
android:layout_marginStart="8dp"
|
||||
app:layout_constraintTop_toTopOf="@id/icon"
|
||||
app:layout_constraintBottom_toBottomOf="@id/icon"
|
||||
app:layout_constraintStart_toEndOf="@id/icon"
|
||||
app:layout_constraintEnd_toStartOf="@id/center_vertical_guideline"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintHorizontal_bias="0"
|
||||
/>
|
||||
android:translationY="@dimen/qs_media_icon_offset"
|
||||
android:translationX="@dimen/qs_media_icon_offset"
|
||||
app:layout_constraintEnd_toEndOf="@id/album_art"
|
||||
app:layout_constraintBottom_toBottomOf="@id/album_art"
|
||||
/>
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/media_seamless"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/center_vertical_guideline"
|
||||
@@ -53,20 +39,23 @@
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintWidth_min="48dp"
|
||||
app:layout_constraintHeight_min="48dp"
|
||||
android:paddingTop="@dimen/qs_media_padding"
|
||||
android:paddingEnd="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_center_guideline_padding"
|
||||
/>
|
||||
android:layout_marginBottom="4dp" />
|
||||
|
||||
<Constraint
|
||||
android:id="@+id/media_seamless_fallback"
|
||||
android:layout_width="@dimen/qs_seamless_fallback_icon_size"
|
||||
android:layout_height="@dimen/qs_seamless_fallback_icon_size"
|
||||
android:layout_marginEnd="@dimen/qs_seamless_fallback_end_margin"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_marginStart="@dimen/qs_center_guideline_padding"
|
||||
android:layout_marginEnd="@dimen/qs_seamless_fallback_margin"
|
||||
android:alpha="0.5"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintHorizontal_bias="1"
|
||||
app:layout_constraintTop_toTopOf="@id/icon"
|
||||
app:layout_constraintBottom_toBottomOf="@id/icon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/center_vertical_guideline"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
@@ -75,9 +64,9 @@
|
||||
android:id="@+id/album_art"
|
||||
android:layout_width="@dimen/qs_media_album_size"
|
||||
android:layout_height="@dimen/qs_media_album_size"
|
||||
android:layout_marginTop="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginBottom="@dimen/qqs_media_spacing"
|
||||
android:layout_marginTop="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
@@ -87,11 +76,11 @@
|
||||
android:id="@+id/header_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/qqs_media_spacing"
|
||||
android:layout_marginStart="@dimen/qqs_media_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginStart="@dimen/qs_media_info_margin"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintTop_toBottomOf="@+id/icon"
|
||||
app:layout_constraintTop_toTopOf="@+id/album_art"
|
||||
app:layout_constraintStart_toEndOf="@id/album_art"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0"/>
|
||||
@@ -101,10 +90,10 @@
|
||||
android:id="@+id/header_artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginBottom="@dimen/qqs_media_spacing"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constrainedWidth="true"
|
||||
android:layout_marginTop="@dimen/qs_media_info_spacing"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_title"
|
||||
app:layout_constraintStart_toStartOf="@id/header_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -115,7 +104,6 @@
|
||||
android:id="@+id/media_progress_bar"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="35dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
@@ -125,10 +113,9 @@
|
||||
android:id="@+id/notification_media_progress_time"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="70dp"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/header_artist"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_progress_bar"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
@@ -137,9 +124,10 @@
|
||||
android:id="@+id/action0"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_action_top"
|
||||
android:layout_marginStart="@dimen/qs_media_padding"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/action1"
|
||||
@@ -151,12 +139,12 @@
|
||||
android:id="@+id/action1"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_action_top"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constraintLeft_toRightOf="@id/action0"
|
||||
app:layout_constraintRight_toLeftOf="@id/action2"
|
||||
app:layout_constraintTop_toTopOf="@id/action0"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_progress_bar"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
</Constraint>
|
||||
@@ -165,9 +153,10 @@
|
||||
android:id="@+id/action2"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_action_top"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constraintLeft_toRightOf="@id/action1"
|
||||
app:layout_constraintRight_toLeftOf="@id/action3"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_progress_bar"
|
||||
@@ -178,9 +167,10 @@
|
||||
android:id="@+id/action3"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_action_top"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constraintLeft_toRightOf="@id/action2"
|
||||
app:layout_constraintRight_toLeftOf="@id/action4"
|
||||
app:layout_constraintTop_toBottomOf="@id/media_progress_bar"
|
||||
@@ -191,9 +181,10 @@
|
||||
android:id="@+id/action4"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_panel_outer_padding"
|
||||
android:layout_marginTop="@dimen/qs_media_action_top"
|
||||
android:layout_marginStart="@dimen/qs_media_action_spacing"
|
||||
android:layout_marginEnd="@dimen/qs_media_padding"
|
||||
android:layout_marginBottom="@dimen/qs_media_padding"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintLeft_toRightOf="@id/action3"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.android.systemui.media
|
||||
|
||||
import android.animation.ArgbEvaluator
|
||||
import android.app.smartspace.SmartspaceTarget
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
@@ -116,8 +115,7 @@ class MediaCarouselController @Inject constructor(
|
||||
private var needsReordering: Boolean = false
|
||||
private var keysNeedRemoval = mutableSetOf<String>()
|
||||
private var bgColor = getBackgroundColor()
|
||||
private var fgColor = com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.textColorPrimary).defaultColor
|
||||
private var fgColor = getForegroundColor()
|
||||
private var isRtl: Boolean = false
|
||||
set(value) {
|
||||
if (value != field) {
|
||||
@@ -359,9 +357,7 @@ class MediaCarouselController @Inject constructor(
|
||||
|
||||
private fun recreatePlayers() {
|
||||
bgColor = getBackgroundColor()
|
||||
|
||||
fgColor = com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.textColorPrimary).defaultColor
|
||||
fgColor = getForegroundColor()
|
||||
pageIndicator.tintList = ColorStateList.valueOf(fgColor)
|
||||
|
||||
MediaPlayerData.mediaData().forEach { (key, data) ->
|
||||
@@ -371,12 +367,12 @@ class MediaCarouselController @Inject constructor(
|
||||
}
|
||||
|
||||
private fun getBackgroundColor(): Int {
|
||||
val themeAccent = com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.colorAccent).defaultColor
|
||||
val themeBackground = com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.colorBackground).defaultColor
|
||||
// Simulate transparency - cannot be actually transparent because of lockscreen
|
||||
return ArgbEvaluator().evaluate(0.25f, themeBackground, themeAccent) as Int
|
||||
return context.getColor(android.R.color.system_accent2_50)
|
||||
}
|
||||
|
||||
private fun getForegroundColor(): Int {
|
||||
return com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.textColorPrimary).defaultColor
|
||||
}
|
||||
|
||||
private fun updatePageIndicator() {
|
||||
|
||||
@@ -25,7 +25,6 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Outline;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.Icon;
|
||||
@@ -33,10 +32,8 @@ import android.media.session.MediaController;
|
||||
import android.media.session.MediaSession;
|
||||
import android.media.session.PlaybackState;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemProperties;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
@@ -46,7 +43,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.UiThread;
|
||||
import androidx.constraintlayout.widget.ConstraintSet;
|
||||
|
||||
import com.android.settingslib.Utils;
|
||||
import com.android.settingslib.widget.AdaptiveIcon;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.animation.ActivityLaunchAnimator;
|
||||
@@ -75,11 +71,6 @@ public class MediaControlPanel {
|
||||
private static final String EXTRAS_MEDIA_SOURCE_PACKAGE_NAME = "package_name";
|
||||
private static final int MEDIA_RECOMMENDATION_MAX_NUM = 4;
|
||||
|
||||
private final boolean mShowAppName = SystemProperties.getBoolean(
|
||||
"persist.sysui.qs_media_show_app_name", false);
|
||||
private final boolean mShowDeviceName = SystemProperties.getBoolean(
|
||||
"persist.sysui.qs_media_show_device_name", false);
|
||||
|
||||
private static final Intent SETTINGS_INTENT = new Intent(ACTION_MEDIA_CONTROLS_SETTINGS);
|
||||
|
||||
// Button IDs for QS controls
|
||||
@@ -106,10 +97,8 @@ public class MediaControlPanel {
|
||||
private KeyguardDismissUtil mKeyguardDismissUtil;
|
||||
private Lazy<MediaDataManager> mMediaDataManagerLazy;
|
||||
private int mBackgroundColor;
|
||||
private int mDevicePadding;
|
||||
private int mAlbumArtSize;
|
||||
private int mAlbumArtRadius;
|
||||
// This will provide the corners for the album art.
|
||||
private final ViewOutlineProvider mViewOutlineProvider;
|
||||
private final MediaOutputDialogFactory mMediaOutputDialogFactory;
|
||||
|
||||
/**
|
||||
@@ -133,13 +122,6 @@ public class MediaControlPanel {
|
||||
mKeyguardDismissUtil = keyguardDismissUtil;
|
||||
mMediaOutputDialogFactory = mediaOutputDialogFactory;
|
||||
loadDimens();
|
||||
|
||||
mViewOutlineProvider = new ViewOutlineProvider() {
|
||||
@Override
|
||||
public void getOutline(View view, Outline outline) {
|
||||
outline.setRoundRect(0, 0, mAlbumArtSize, mAlbumArtSize, mAlbumArtRadius);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
@@ -151,9 +133,9 @@ public class MediaControlPanel {
|
||||
}
|
||||
|
||||
private void loadDimens() {
|
||||
mAlbumArtRadius = mContext.getResources().getDimensionPixelSize(
|
||||
Utils.getThemeAttr(mContext, android.R.attr.dialogCornerRadius));
|
||||
mAlbumArtSize = mContext.getResources().getDimensionPixelSize(R.dimen.qs_media_album_size);
|
||||
mDevicePadding = mContext.getResources()
|
||||
.getDimensionPixelSize(R.dimen.qs_media_album_device_padding);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -211,10 +193,6 @@ public class MediaControlPanel {
|
||||
mPlayerViewHolder = vh;
|
||||
TransitionLayout player = vh.getPlayer();
|
||||
|
||||
ImageView albumView = vh.getAlbumView();
|
||||
albumView.setOutlineProvider(mViewOutlineProvider);
|
||||
albumView.setClipToOutline(true);
|
||||
|
||||
mSeekBarObserver = new SeekBarObserver(vh);
|
||||
mSeekBarViewModel.getProgress().observeForever(mSeekBarObserver);
|
||||
mSeekBarViewModel.attachTouchHandlers(vh.getSeekBar());
|
||||
@@ -297,10 +275,19 @@ public class MediaControlPanel {
|
||||
boolean hasArtwork = data.getArtwork() != null;
|
||||
if (hasArtwork) {
|
||||
Drawable artwork = scaleDrawable(data.getArtwork());
|
||||
albumView.setPadding(0, 0, 0, 0);
|
||||
albumView.setImageDrawable(artwork);
|
||||
} else {
|
||||
Drawable deviceIcon;
|
||||
if (data.getDevice() != null && data.getDevice().getIcon() != null) {
|
||||
deviceIcon = data.getDevice().getIcon().getConstantState().newDrawable().mutate();
|
||||
} else {
|
||||
deviceIcon = getContext().getDrawable(R.drawable.ic_headphone);
|
||||
}
|
||||
deviceIcon.setTintList(ColorStateList.valueOf(mBackgroundColor));
|
||||
albumView.setPadding(mDevicePadding, mDevicePadding, mDevicePadding, mDevicePadding);
|
||||
albumView.setImageDrawable(deviceIcon);
|
||||
}
|
||||
setVisibleAndAlpha(collapsedSet, R.id.album_art, hasArtwork);
|
||||
setVisibleAndAlpha(expandedSet, R.id.album_art, hasArtwork);
|
||||
|
||||
// App icon
|
||||
ImageView appIcon = mPlayerViewHolder.getAppIcon();
|
||||
@@ -315,13 +302,6 @@ public class MediaControlPanel {
|
||||
TextView titleText = mPlayerViewHolder.getTitleText();
|
||||
titleText.setText(data.getSong());
|
||||
|
||||
// App title
|
||||
TextView appName = mPlayerViewHolder.getAppName();
|
||||
appName.setText(data.getApp());
|
||||
appName.setVisibility(mShowAppName ? View.VISIBLE : View.GONE);
|
||||
setVisibleAndAlpha(collapsedSet, R.id.app_name, mShowAppName);
|
||||
setVisibleAndAlpha(expandedSet, R.id.app_name, mShowAppName);
|
||||
|
||||
// Artist name
|
||||
TextView artistText = mPlayerViewHolder.getArtistText();
|
||||
artistText.setText(data.getArtist());
|
||||
@@ -333,10 +313,6 @@ public class MediaControlPanel {
|
||||
mPlayerViewHolder.getSeamless().setOnClickListener(v -> {
|
||||
mMediaOutputDialogFactory.create(data.getPackageName(), true);
|
||||
});
|
||||
TextView mDeviceName = mPlayerViewHolder.getSeamlessText();
|
||||
mDeviceName.setVisibility(mShowDeviceName ? View.VISIBLE : View.GONE);
|
||||
setVisibleAndAlpha(collapsedSet, R.id.media_seamless_text, mShowDeviceName);
|
||||
setVisibleAndAlpha(expandedSet, R.id.media_seamless_text, mShowDeviceName);
|
||||
|
||||
ImageView iconView = mPlayerViewHolder.getSeamlessIcon();
|
||||
TextView deviceName = mPlayerViewHolder.getSeamlessText();
|
||||
@@ -406,8 +382,12 @@ public class MediaControlPanel {
|
||||
|
||||
// Hide any unused buttons
|
||||
for (; i < ACTION_IDS.length; i++) {
|
||||
setVisibleAndAlpha(expandedSet, ACTION_IDS[i], false /*visible */);
|
||||
setVisibleAndAlpha(collapsedSet, ACTION_IDS[i], false /*visible */);
|
||||
setVisibleAndAlpha(expandedSet, ACTION_IDS[i], false /* visible */);
|
||||
}
|
||||
// If no expanded buttons, set the first view as INVISIBLE so z remains constant
|
||||
if (actionIcons.size() == 0) {
|
||||
expandedSet.setVisibility(ACTION_IDS[0], ConstraintSet.INVISIBLE);
|
||||
}
|
||||
|
||||
// Seek Bar
|
||||
|
||||
@@ -31,7 +31,7 @@ data class MediaData(
|
||||
*/
|
||||
val app: String?,
|
||||
/**
|
||||
* Icon shown on player, close to app name.
|
||||
* App icon shown on player.
|
||||
*/
|
||||
val appIcon: Icon?,
|
||||
/**
|
||||
|
||||
@@ -115,12 +115,15 @@ class MediaDataManager(
|
||||
// UI surface label for subscribing Smartspace updates.
|
||||
@JvmField
|
||||
val SMARTSPACE_UI_SURFACE_LABEL = "media_data_manager"
|
||||
|
||||
// Maximum number of actions allowed in compact view
|
||||
@JvmField
|
||||
val MAX_COMPACT_ACTIONS = 3
|
||||
}
|
||||
|
||||
private val themeText = com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.textColorPrimary).defaultColor
|
||||
private val bgColor = com.android.settingslib.Utils.getColorAttr(context,
|
||||
com.android.internal.R.attr.colorBackground).defaultColor
|
||||
private val bgColor = context.getColor(android.R.color.system_accent2_50)
|
||||
|
||||
// Internal listeners are part of the internal pipeline. External listeners (those registered
|
||||
// with [MediaDeviceManager.addListener]) receive events after they have propagated through
|
||||
@@ -549,8 +552,12 @@ class MediaDataManager(
|
||||
// Control buttons
|
||||
val actionIcons: MutableList<MediaAction> = ArrayList()
|
||||
val actions = notif.actions
|
||||
val actionsToShowCollapsed = notif.extras.getIntArray(
|
||||
var actionsToShowCollapsed = notif.extras.getIntArray(
|
||||
Notification.EXTRA_COMPACT_ACTIONS)?.toMutableList() ?: mutableListOf<Int>()
|
||||
if (actionsToShowCollapsed.size > MAX_COMPACT_ACTIONS) {
|
||||
Log.e(TAG, "Too many compact actions for $key, limiting to first $MAX_COMPACT_ACTIONS")
|
||||
actionsToShowCollapsed = actionsToShowCollapsed.subList(0, MAX_COMPACT_ACTIONS)
|
||||
}
|
||||
// TODO: b/153736623 look into creating actions when this isn't a media style notification
|
||||
|
||||
if (actions != null) {
|
||||
|
||||
@@ -35,7 +35,6 @@ class PlayerViewHolder private constructor(itemView: View) {
|
||||
|
||||
// Player information
|
||||
val appIcon = itemView.requireViewById<ImageView>(R.id.icon)
|
||||
val appName = itemView.requireViewById<TextView>(R.id.app_name)
|
||||
val albumView = itemView.requireViewById<ImageView>(R.id.album_art)
|
||||
val titleText = itemView.requireViewById<TextView>(R.id.header_title)
|
||||
val artistText = itemView.requireViewById<TextView>(R.id.header_artist)
|
||||
@@ -120,6 +119,7 @@ class PlayerViewHolder private constructor(itemView: View) {
|
||||
R.id.header_title,
|
||||
R.id.header_artist,
|
||||
R.id.media_seamless,
|
||||
R.id.media_seamless_fallback,
|
||||
R.id.notification_media_progress_time,
|
||||
R.id.media_progress_bar,
|
||||
R.id.action0,
|
||||
@@ -130,7 +130,6 @@ class PlayerViewHolder private constructor(itemView: View) {
|
||||
R.id.icon
|
||||
)
|
||||
val gutsIds = setOf(
|
||||
R.id.media_text,
|
||||
R.id.remove_text,
|
||||
R.id.cancel,
|
||||
R.id.dismiss,
|
||||
|
||||
@@ -20,7 +20,6 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.annotation.IntegerRes
|
||||
import com.android.systemui.R
|
||||
import com.android.systemui.util.animation.TransitionLayout
|
||||
@@ -56,7 +55,6 @@ class RecommendationViewHolder private constructor(itemView: View) {
|
||||
val cancel = itemView.requireViewById<View>(R.id.cancel)
|
||||
val dismiss = itemView.requireViewById<ViewGroup>(R.id.dismiss)
|
||||
val dismissLabel = dismiss.getChildAt(0)
|
||||
val recommendationText = itemView.requireViewById<TextView>(R.id.recommendation_text)
|
||||
val settings = itemView.requireViewById<View>(R.id.settings)
|
||||
|
||||
init {
|
||||
@@ -105,7 +103,6 @@ class RecommendationViewHolder private constructor(itemView: View) {
|
||||
|
||||
// Res Ids for the components on the guts panel.
|
||||
val gutsIds = setOf(
|
||||
R.id.recommendation_text,
|
||||
R.id.remove_text,
|
||||
R.id.cancel,
|
||||
R.id.dismiss,
|
||||
|
||||
@@ -78,6 +78,7 @@ class SeekBarObserver(private val holder: PlayerViewHolder) : Observer<SeekBarVi
|
||||
fun setVerticalPadding(padding: Int) {
|
||||
val leftPadding = holder.seekBar.paddingLeft
|
||||
val rightPadding = holder.seekBar.paddingRight
|
||||
holder.seekBar.setPadding(leftPadding, padding, rightPadding, padding)
|
||||
val bottomPadding = holder.seekBar.paddingBottom
|
||||
holder.seekBar.setPadding(leftPadding, padding, rightPadding, bottomPadding)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class QSPanel extends LinearLayout implements Tunable {
|
||||
|
||||
mHorizontalTileLayout = createHorizontalTileLayout();
|
||||
LayoutParams lp = new LayoutParams(0, LayoutParams.WRAP_CONTENT, 1);
|
||||
int marginSize = (int) mContext.getResources().getDimension(R.dimen.qqs_media_spacing);
|
||||
int marginSize = (int) mContext.getResources().getDimension(R.dimen.qs_media_padding);
|
||||
lp.setMarginStart(0);
|
||||
lp.setMarginEnd(marginSize);
|
||||
lp.gravity = Gravity.CENTER_VERTICAL;
|
||||
|
||||
@@ -95,7 +95,6 @@ public class MediaControlPanelTest : SysuiTestCase() {
|
||||
@Mock private lateinit var collapsedSet: ConstraintSet
|
||||
@Mock private lateinit var mediaOutputDialogFactory: MediaOutputDialogFactory
|
||||
private lateinit var appIcon: ImageView
|
||||
private lateinit var appName: TextView
|
||||
private lateinit var albumView: ImageView
|
||||
private lateinit var titleText: TextView
|
||||
private lateinit var artistText: TextView
|
||||
@@ -138,8 +137,6 @@ public class MediaControlPanelTest : SysuiTestCase() {
|
||||
whenever(holder.player).thenReturn(view)
|
||||
appIcon = ImageView(context)
|
||||
whenever(holder.appIcon).thenReturn(appIcon)
|
||||
appName = TextView(context)
|
||||
whenever(holder.appName).thenReturn(appName)
|
||||
albumView = ImageView(context)
|
||||
whenever(holder.albumView).thenReturn(albumView)
|
||||
titleText = TextView(context)
|
||||
@@ -220,7 +217,6 @@ public class MediaControlPanelTest : SysuiTestCase() {
|
||||
val state = MediaData(USER_ID, true, BG_COLOR, APP, null, ARTIST, TITLE, null, emptyList(),
|
||||
emptyList(), PACKAGE, session.getSessionToken(), null, device, true, null)
|
||||
player.bindPlayer(state, PACKAGE)
|
||||
assertThat(appName.getText()).isEqualTo(APP)
|
||||
assertThat(titleText.getText()).isEqualTo(TITLE)
|
||||
assertThat(artistText.getText()).isEqualTo(ARTIST)
|
||||
}
|
||||
|
||||
@@ -425,4 +425,30 @@ class MediaDataManagerTest : SysuiTestCase() {
|
||||
assertThat(mediaDataCaptor.value.resumption).isTrue()
|
||||
assertThat(mediaDataCaptor.value.lastActive).isLessThan(currentTimeMillis)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testTooManyCompactActions_isTruncated() {
|
||||
// GIVEN a notification where too many compact actions were specified
|
||||
val notif = SbnBuilder().run {
|
||||
setPkg(PACKAGE_NAME)
|
||||
modifyNotification(context).also {
|
||||
it.setSmallIcon(android.R.drawable.ic_media_pause)
|
||||
it.setStyle(MediaStyle().apply {
|
||||
setMediaSession(session.sessionToken)
|
||||
setShowActionsInCompactView(0, 1, 2, 3, 4)
|
||||
})
|
||||
}
|
||||
build()
|
||||
}
|
||||
|
||||
// WHEN the notification is loaded
|
||||
mediaDataManager.onNotificationAdded(KEY, notif)
|
||||
assertThat(backgroundExecutor.runAllReady()).isEqualTo(1)
|
||||
assertThat(foregroundExecutor.runAllReady()).isEqualTo(1)
|
||||
|
||||
// THEN only the first MAX_COMPACT_ACTIONS are actually set
|
||||
verify(listener).onMediaDataLoaded(eq(KEY), eq(null), capture(mediaDataCaptor))
|
||||
assertThat(mediaDataCaptor.value.actionsToShowInCompact.size).isEqualTo(
|
||||
MediaDataManager.MAX_COMPACT_ACTIONS)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user