diff options
author | 2024-12-16 14:32:10 -0800 | |
---|---|---|
committer | 2024-12-16 14:32:10 -0800 | |
commit | 7177560ed60a9d57c439a523a0cee8d6fb62a1ae (patch) | |
tree | 7b46b66d9fbf05541392b2a490013dc822b6fae7 | |
parent | c6ea635d9ae1e3ebf87b3aab49fddb31f960891b (diff) | |
parent | 4c27a8791be5a3350e5799e146f5b684b0067ede (diff) |
Merge "Set UMO settings icon to dynamic color on communal" into main
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt index f0f8a9592b6f..4e97eb5bc9d1 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt @@ -32,6 +32,7 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.view.animation.PathInterpolator +import android.widget.ImageView import android.widget.LinearLayout import androidx.annotation.VisibleForTesting import androidx.lifecycle.Lifecycle @@ -207,7 +208,7 @@ constructor( val mediaFrame: ViewGroup @VisibleForTesting - lateinit var settingsButton: View + lateinit var settingsButton: ImageView private set private val mediaContent: ViewGroup @@ -650,7 +651,7 @@ constructor( private fun inflateSettingsButton() { val settings = LayoutInflater.from(context) - .inflate(R.layout.media_carousel_settings_button, mediaFrame, false) as View + .inflate(R.layout.media_carousel_settings_button, mediaFrame, false) as ImageView if (this::settingsButton.isInitialized) { mediaFrame.removeView(settingsButton) } @@ -1493,6 +1494,17 @@ constructor( this.desiredHostState = it currentlyExpanded = it.expansion > 0 + // Set color of the settings button to material "on primary" color when media is on + // communal for aesthetic and accessibility purposes since the background of + // Glanceable Hub is a dynamic color. + if (desiredLocation == MediaHierarchyManager.LOCATION_COMMUNAL_HUB) { + settingsButton.setColorFilter( + context.getColor(com.android.internal.R.color.materialColorOnPrimary) + ) + } else { + settingsButton.setColorFilter(context.getColor(R.color.notification_gear_color)) + } + val shouldCloseGuts = !currentlyExpanded && !mediaManager.hasActiveMediaOrRecommendation() && |