diff options
| author | 2024-05-24 23:17:25 +0000 | |
|---|---|---|
| committer | 2024-05-28 12:15:51 +0000 | |
| commit | 8e583ead271a53c901a72dbf193e938a1b812eb1 (patch) | |
| tree | 45163cb2c00982efdf639a605df6a5a012f2f01a | |
| parent | 7f39ea9bc4ca5b6893a7cf1cc0fa742c3b9c71da (diff) | |
Adjust width of album art
This CL adjust the width of UMO background to match the width of
carousel being set by flexiglass.
Flag: com.android.systemui.scene_container
Fixes: 312714128
Test: Checked UI, UMO background is taking the whole width of the
transition layout.
Change-Id: Ia80a7b36aa3e10a897e07fb48af1f0316a227bae
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt index fed93f037638..72fb218865b2 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt @@ -157,7 +157,6 @@ object MediaControlViewBinder { viewController, backgroundDispatcher, mainDispatcher, - mediaFlags, isSongUpdated ) @@ -414,7 +413,6 @@ object MediaControlViewBinder { viewController: MediaViewController, backgroundDispatcher: CoroutineDispatcher, mainDispatcher: CoroutineDispatcher, - mediaFlags: MediaFlags, updateBackground: Boolean, ) { val traceCookie = viewHolder.hashCode() @@ -424,13 +422,8 @@ object MediaControlViewBinder { viewController.isArtworkBound = false } // Capture width & height from views in foreground for artwork scaling in background - var width = viewHolder.albumView.measuredWidth - var height = viewHolder.albumView.measuredHeight - if (mediaFlags.isSceneContainerEnabled() && (width <= 0 || height <= 0)) { - // TODO(b/312714128): ensure we have a valid size before setting background - width = viewController.widthInSceneContainerPx - height = viewController.heightInSceneContainerPx - } + val width = viewController.widthInSceneContainerPx + val height = viewController.heightInSceneContainerPx withContext(backgroundDispatcher) { val artwork = if (viewModel.shouldAddGradient) { @@ -449,6 +442,11 @@ object MediaControlViewBinder { val colorSchemeChanged = viewController.colorSchemeTransition.updateColorScheme(viewModel.colorScheme) val albumView = viewHolder.albumView + + // Set up width of album view constraint. + viewController.expandedLayout.getConstraint(albumView.id).layout.mWidth = width + viewController.collapsedLayout.getConstraint(albumView.id).layout.mWidth = width + albumView.setPadding(0, 0, 0, 0) if ( updateBackground || |