diff --git a/packages/SystemUI/res/drawable/qs_media_button_background.xml b/packages/SystemUI/res/drawable/qs_media_button_background.xml
index 2241abf130e30..ed9bd263a79df 100644
--- a/packages/SystemUI/res/drawable/qs_media_button_background.xml
+++ b/packages/SystemUI/res/drawable/qs_media_button_background.xml
@@ -26,4 +26,5 @@
android:right="16dp"
android:top="8dp"
android:bottom="8dp" />
+
\ No newline at end of file
diff --git a/packages/SystemUI/res/layout/media_carousel.xml b/packages/SystemUI/res/layout/media_carousel.xml
index 95cee66af5362..87acfd088939f 100644
--- a/packages/SystemUI/res/layout/media_carousel.xml
+++ b/packages/SystemUI/res/layout/media_carousel.xml
@@ -22,7 +22,7 @@
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
- >
+ android:theme="@style/MediaPlayer">
diff --git a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
index 85354266f2288..8c54e2c1cec4f 100644
--- a/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
+++ b/packages/SystemUI/res/layout/media_smartspace_recommendations.xml
@@ -19,7 +19,6 @@
+ android:background="@drawable/qs_media_background"
+ android:theme="@style/MediaPlayer">
+ android:tint="?android:attr/textColor" />
@@ -68,7 +67,7 @@
android:layout_height="@dimen/qs_aa_media_rec_album_size"
android:adjustViewBounds="true"
android:background="@drawable/bg_smartspace_media_item"
- android:backgroundTint="?androidprv:attr/colorAccentSecondary"
+ style="@style/MediaPlayer.Album"
android:clipToOutline="true"
android:scaleType="centerCrop"/>
@@ -76,7 +75,7 @@
android:id="@+id/media_logo1"
android:layout_width="@dimen/qs_media_icon_size"
android:layout_height="@dimen/qs_media_icon_size"
- android:background="@drawable/qs_media_icon_background" />
+ style="@style/MediaPlayer.AppIcon" />
@@ -92,7 +91,7 @@
android:id="@+id/media_logo2"
android:layout_width="@dimen/qs_media_icon_size"
android:layout_height="@dimen/qs_media_icon_size"
- android:background="@drawable/qs_media_icon_background" />
+ style="@style/MediaPlayer.AppIcon" />
@@ -108,7 +107,7 @@
android:id="@+id/media_logo3"
android:layout_width="@dimen/qs_media_icon_size"
android:layout_height="@dimen/qs_media_icon_size"
- android:background="@drawable/qs_media_icon_background" />
+ style="@style/MediaPlayer.AppIcon" />
@@ -124,7 +123,7 @@
android:id="@+id/media_logo4"
android:layout_width="@dimen/qs_media_icon_size"
android:layout_height="@dimen/qs_media_icon_size"
- android:background="@drawable/qs_media_icon_background" />
+ style="@style/MediaPlayer.AppIcon" />
@@ -140,7 +139,7 @@
android:id="@+id/media_logo5"
android:layout_width="@dimen/qs_media_icon_size"
android:layout_height="@dimen/qs_media_icon_size"
- android:background="@drawable/qs_media_icon_background" />
+ style="@style/MediaPlayer.AppIcon" />
@@ -156,7 +155,7 @@
android:id="@+id/media_logo6"
android:layout_width="@dimen/qs_media_icon_size"
android:layout_height="@dimen/qs_media_icon_size"
- android:background="@drawable/qs_media_icon_background" />
+ style="@style/MediaPlayer.AppIcon" />
@@ -216,9 +212,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"
+ style="@style/MediaPlayer.OutlineButton"
android:text="@string/cancel" />
@@ -239,9 +233,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"
+ style="@style/MediaPlayer.OutlineButton"
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 cdced5a1be717..e9a24e2846011 100644
--- a/packages/SystemUI/res/layout/media_view.xml
+++ b/packages/SystemUI/res/layout/media_view.xml
@@ -18,7 +18,6 @@
+ android:background="@drawable/qs_media_background"
+ android:theme="@style/MediaPlayer">
@@ -65,7 +64,6 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:fontFamily="@*android:string/config_bodyFontFamily"
- android:textColor="?android:attr/textColorPrimary"
android:gravity="end"
android:textSize="12sp" />
@@ -86,31 +84,31 @@
@@ -120,8 +118,8 @@
android:layout_width="@dimen/qs_media_album_size"
android:layout_height="@dimen/qs_media_album_size"
android:layout_gravity="center_vertical"
+ style="@style/MediaPlayer.Album"
android:background="@drawable/qs_media_art_background"
- android:backgroundTint="?androidprv:attr/colorAccentSecondary"
android:clipToOutline="true" />
@@ -138,6 +136,7 @@
@@ -146,7 +145,6 @@
android:layout_width="@dimen/qs_seamless_icon_size"
android:layout_height="@dimen/qs_seamless_icon_size"
android:layout_gravity="center"
- android:tint="?android:attr/colorPrimary"
android:src="@*android:drawable/ic_media_seamless" />
@@ -171,7 +168,7 @@
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:tint="?android:attr/textColor"
android:src="@drawable/ic_cast_connected"
android:forceHasOverlappingRendering="false" />
@@ -179,17 +176,13 @@
@@ -199,7 +192,6 @@
android:layout_height="wrap_content"
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
android:singleLine="true"
- android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp" />
@@ -209,16 +201,14 @@
android:layout_height="wrap_content"
android:fontFamily="@*android:string/config_headlineFontFamily"
android:singleLine="true"
- android:textColor="?android:attr/textColorSecondary"
+ style="@style/MediaPlayer.Subtitle"
android:textSize="14sp" />
+ android:layout_height="@dimen/qs_media_icon_size" />
@@ -278,9 +265,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"
+ style="@style/MediaPlayer.OutlineButton"
android:text="@string/cancel" />
@@ -301,9 +286,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"
+ style="@style/MediaPlayer.OutlineButton"
android:text="@string/controls_media_dismiss_button"
/>
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index ac9ced93f2df7..aa1f954cb27aa 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -14,7 +14,8 @@
limitations under the License.
-->
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
index 6a2d0afa813b1..24503675ae369 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt
@@ -3,7 +3,6 @@ package com.android.systemui.media
import android.app.smartspace.SmartspaceTarget
import android.content.Context
import android.content.Intent
-import android.content.res.ColorStateList
import android.content.res.Configuration
import android.provider.Settings.ACTION_MEDIA_CONTROLS_SETTINGS
import android.util.Log
@@ -116,7 +115,6 @@ class MediaCarouselController @Inject constructor(
private var needsReordering: Boolean = false
private var keysNeedRemoval = mutableSetOf()
private var bgColor = getBackgroundColor()
- private var fgColor = getForegroundColor()
private var isRtl: Boolean = false
set(value) {
if (value != field) {
@@ -276,10 +274,6 @@ class MediaCarouselController @Inject constructor(
}
private fun addOrUpdatePlayer(key: String, oldKey: String?, data: MediaData) {
- data.actions.forEach {
- it.icon?.setTintList(ColorStateList.valueOf(fgColor))
- }
- data.appIcon?.setTintList(ColorStateList.valueOf(fgColor))
val dataCopy = data.copy(backgroundColor = bgColor)
val existingPlayer = MediaPlayerData.getMediaPlayer(key, oldKey)
if (existingPlayer == null) {
@@ -328,7 +322,7 @@ class MediaCarouselController @Inject constructor(
val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT)
newRecs.recommendationViewHolder?.recommendations?.setLayoutParams(lp)
- newRecs.bindRecommendation(data, fgColor, bgColor)
+ newRecs.bindRecommendation(data, bgColor)
MediaPlayerData.addMediaPlayer(key, newRecs)
updatePlayerToState(newRecs, noAnimation = true)
reorderAllPlayers()
@@ -368,8 +362,6 @@ class MediaCarouselController @Inject constructor(
private fun recreatePlayers() {
bgColor = getBackgroundColor()
- fgColor = getForegroundColor()
- pageIndicator.tintList = ColorStateList.valueOf(fgColor)
MediaPlayerData.mediaData().forEach { (key, data) ->
removePlayer(key, dismissMediaData = false)
@@ -381,11 +373,6 @@ class MediaCarouselController @Inject constructor(
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() {
val numPages = mediaContent.getChildCount()
pageIndicator.setNumPages(numPages)
diff --git a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
index ed16777110c90..1e9cc8cb08ccf 100644
--- a/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/MediaControlPanel.java
@@ -265,9 +265,6 @@ public class MediaControlPanel {
ConstraintSet expandedSet = mMediaViewController.getExpandedLayout();
ConstraintSet collapsedSet = mMediaViewController.getCollapsedLayout();
- mPlayerViewHolder.getPlayer().setBackgroundTintList(
- ColorStateList.valueOf(mBackgroundColor));
-
// Click action
PendingIntent clickIntent = data.getClickIntent();
if (clickIntent != null) {
@@ -465,15 +462,11 @@ public class MediaControlPanel {
/** Bind this recommendation view based on the data given. */
public void bindRecommendation(
@NonNull SmartspaceTarget target,
- @NonNull int primaryColor,
@NonNull int backgroundColor) {
if (mRecommendationViewHolder == null) {
return;
}
- mRecommendationViewHolder.getCardIcon().setColorFilter(primaryColor);
- mRecommendationViewHolder.getCardText().setTextColor(primaryColor);
-
mInstanceId = target.getSmartspaceTargetId().hashCode();
mRecommendationViewHolder.getRecommendations()
.setBackgroundTintList(ColorStateList.valueOf(backgroundColor));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt
index 94252d2b83310..800daa1e96aa0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/MediaControlPanelTest.kt
@@ -17,7 +17,6 @@
package com.android.systemui.media
import android.content.Intent
-import android.content.res.ColorStateList
import android.graphics.Color
import android.graphics.drawable.GradientDrawable
import android.graphics.drawable.RippleDrawable
@@ -221,17 +220,6 @@ public class MediaControlPanelTest : SysuiTestCase() {
assertThat(artistText.getText()).isEqualTo(ARTIST)
}
- @Test
- fun bindBackgroundColor() {
- player.attachPlayer(holder)
- 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)
- val list = ArgumentCaptor.forClass(ColorStateList::class.java)
- verify(view).setBackgroundTintList(list.capture())
- assertThat(list.value).isEqualTo(ColorStateList.valueOf(BG_COLOR))
- }
-
@Test
fun bindDevice() {
player.attachPlayer(holder)