diff --git a/packages/SystemUI/res/drawable/qs_media_art_background.xml b/packages/SystemUI/res/drawable/qs_media_art_background.xml
new file mode 100644
index 0000000000000..95a1870941136
--- /dev/null
+++ b/packages/SystemUI/res/drawable/qs_media_art_background.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/packages/SystemUI/res/drawable/qs_media_button_background.xml b/packages/SystemUI/res/drawable/qs_media_button_background.xml
new file mode 100644
index 0000000000000..2241abf130e30
--- /dev/null
+++ b/packages/SystemUI/res/drawable/qs_media_button_background.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/qs_media_icon_background.xml b/packages/SystemUI/res/drawable/qs_media_icon_background.xml
new file mode 100644
index 0000000000000..a3a29865c1041
--- /dev/null
+++ b/packages/SystemUI/res/drawable/qs_media_icon_background.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
diff --git a/packages/SystemUI/res-keyguard/drawable/qs_media_seamless_background.xml b/packages/SystemUI/res/drawable/qs_media_seamless_background.xml
similarity index 85%
rename from packages/SystemUI/res-keyguard/drawable/qs_media_seamless_background.xml
rename to packages/SystemUI/res/drawable/qs_media_seamless_background.xml
index 8e3768697f6af..e71c3d380be3d 100644
--- a/packages/SystemUI/res-keyguard/drawable/qs_media_seamless_background.xml
+++ b/packages/SystemUI/res/drawable/qs_media_seamless_background.xml
@@ -20,6 +20,11 @@
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
index f4a743490181b..9210d05bf72ef 100644
--- a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
+++ b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
@@ -89,30 +89,18 @@
-
-
@@ -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"
diff --git a/packages/SystemUI/res/layout/media_view.xml b/packages/SystemUI/res/layout/media_view.xml
index a4cf5eddb30e2..cdced5a1be717 100644
--- a/packages/SystemUI/res/layout/media_view.xml
+++ b/packages/SystemUI/res/layout/media_view.xml
@@ -18,6 +18,7 @@
+ app:layout_constraintGuide_percent="0.6" />
+
+
+ android:textSize="12sp" />
+ android:textSize="12sp" />
+ />
+ android:layout_width="48dp"
+ android:layout_height="48dp" />
+ android:layout_gravity="center_vertical"
+ android:background="@drawable/qs_media_art_background"
+ android:backgroundTint="?androidprv:attr/colorAccentSecondary"
+ android:clipToOutline="true" />
+ android:textSize="12sp" />
@@ -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" />
-
-
-
+ 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"
+ />
-
+
-
-
@@ -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">
@@ -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">
16dp
- 16dp
- 120dp
+ 72dp
+ 92dp
14dp
- 16dp
+ 26dp
+ 12dp
+ 4dp
+ 20dp
+ 4dp
10dp
- @dimen/qs_media_icon_size
+ 4dp
+ 8dp
+ 24dp
+ 16dp
@dimen/qs_seamless_icon_size
- 16dp
- 16dp
+ 20dp
22dp
1dp
- 3dp
- 15dp
- 16dp
+ 2dp
+ 35dp
+ 36dp
80dp
20dp
-
35dp
15dp
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index c117069f794b9..9d4489388f3b6 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -2824,10 +2824,10 @@
Media
-
- Hide the current session.
-
- Current session cannot be hidden.
+
+ Hide this media session?
+
+ The current media session cannot be hidden.
Dismiss
diff --git a/packages/SystemUI/res/xml/media_collapsed.xml b/packages/SystemUI/res/xml/media_collapsed.xml
index f83e3a1d9b262..9bd462e66e3b7 100644
--- a/packages/SystemUI/res/xml/media_collapsed.xml
+++ b/packages/SystemUI/res/xml/media_collapsed.xml
@@ -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"
- />
-
-
@@ -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"
>
@@ -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"
diff --git a/packages/SystemUI/res/xml/media_expanded.xml b/packages/SystemUI/res/xml/media_expanded.xml
index 7c6772059695d..fd04fa0723aa7 100644
--- a/packages/SystemUI/res/xml/media_expanded.xml
+++ b/packages/SystemUI/res/xml/media_expanded.xml
@@ -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"
- />
-
-
+ 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"
+ />
+ android:layout_marginBottom="4dp" />
@@ -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">
@@ -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"
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
index c3c617c636da4..d87142f195dc0 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
@@ -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()
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() {
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
index 473db9f7bdb5b..96ae2cd377402 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
@@ -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 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
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaData.kt b/packages/SystemUI/src/com/android/systemui/media/MediaData.kt
index 6ef29d694873d..6f0c887104612 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaData.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaData.kt
@@ -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?,
/**
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
index a0708617ef666..138c4222831f5 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaDataManager.kt
@@ -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 = ArrayList()
val actions = notif.actions
- val actionsToShowCollapsed = notif.extras.getIntArray(
+ var actionsToShowCollapsed = notif.extras.getIntArray(
Notification.EXTRA_COMPACT_ACTIONS)?.toMutableList() ?: mutableListOf()
+ 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) {
diff --git a/packages/SystemUI/src/com/android/systemui/media/PlayerViewHolder.kt b/packages/SystemUI/src/com/android/systemui/media/PlayerViewHolder.kt
index 16327bd9064a7..08d87261ae804 100644
--- a/packages/SystemUI/src/com/android/systemui/media/PlayerViewHolder.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/PlayerViewHolder.kt
@@ -35,7 +35,6 @@ class PlayerViewHolder private constructor(itemView: View) {
// Player information
val appIcon = itemView.requireViewById(R.id.icon)
- val appName = itemView.requireViewById(R.id.app_name)
val albumView = itemView.requireViewById(R.id.album_art)
val titleText = itemView.requireViewById(R.id.header_title)
val artistText = itemView.requireViewById(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,
diff --git a/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt b/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt
index 19c83bc83ac39..02150c4a85628 100644
--- a/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/RecommendationViewHolder.kt
@@ -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(R.id.cancel)
val dismiss = itemView.requireViewById(R.id.dismiss)
val dismissLabel = dismiss.getChildAt(0)
- val recommendationText = itemView.requireViewById(R.id.recommendation_text)
val settings = itemView.requireViewById(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,
diff --git a/packages/SystemUI/src/com/android/systemui/media/SeekBarObserver.kt b/packages/SystemUI/src/com/android/systemui/media/SeekBarObserver.kt
index d789501ffdefc..f17ad6f091289 100644
--- a/packages/SystemUI/src/com/android/systemui/media/SeekBarObserver.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/SeekBarObserver.kt
@@ -78,6 +78,7 @@ class SeekBarObserver(private val holder: PlayerViewHolder) : Observer