Loading packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt +7 −9 Original line number Original line Diff line number Diff line Loading @@ -157,7 +157,6 @@ object MediaControlViewBinder { viewController, viewController, backgroundDispatcher, backgroundDispatcher, mainDispatcher, mainDispatcher, mediaFlags, isSongUpdated isSongUpdated ) ) Loading Loading @@ -414,7 +413,6 @@ object MediaControlViewBinder { viewController: MediaViewController, viewController: MediaViewController, backgroundDispatcher: CoroutineDispatcher, backgroundDispatcher: CoroutineDispatcher, mainDispatcher: CoroutineDispatcher, mainDispatcher: CoroutineDispatcher, mediaFlags: MediaFlags, updateBackground: Boolean, updateBackground: Boolean, ) { ) { val traceCookie = viewHolder.hashCode() val traceCookie = viewHolder.hashCode() Loading @@ -424,13 +422,8 @@ object MediaControlViewBinder { viewController.isArtworkBound = false viewController.isArtworkBound = false } } // Capture width & height from views in foreground for artwork scaling in background // Capture width & height from views in foreground for artwork scaling in background var width = viewHolder.albumView.measuredWidth val width = viewController.widthInSceneContainerPx var height = viewHolder.albumView.measuredHeight val height = viewController.heightInSceneContainerPx 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 } withContext(backgroundDispatcher) { withContext(backgroundDispatcher) { val artwork = val artwork = if (viewModel.shouldAddGradient) { if (viewModel.shouldAddGradient) { Loading @@ -449,6 +442,11 @@ object MediaControlViewBinder { val colorSchemeChanged = val colorSchemeChanged = viewController.colorSchemeTransition.updateColorScheme(viewModel.colorScheme) viewController.colorSchemeTransition.updateColorScheme(viewModel.colorScheme) val albumView = viewHolder.albumView 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) albumView.setPadding(0, 0, 0, 0) if ( if ( updateBackground || updateBackground || Loading Loading
packages/SystemUI/src/com/android/systemui/media/controls/ui/binder/MediaControlViewBinder.kt +7 −9 Original line number Original line Diff line number Diff line Loading @@ -157,7 +157,6 @@ object MediaControlViewBinder { viewController, viewController, backgroundDispatcher, backgroundDispatcher, mainDispatcher, mainDispatcher, mediaFlags, isSongUpdated isSongUpdated ) ) Loading Loading @@ -414,7 +413,6 @@ object MediaControlViewBinder { viewController: MediaViewController, viewController: MediaViewController, backgroundDispatcher: CoroutineDispatcher, backgroundDispatcher: CoroutineDispatcher, mainDispatcher: CoroutineDispatcher, mainDispatcher: CoroutineDispatcher, mediaFlags: MediaFlags, updateBackground: Boolean, updateBackground: Boolean, ) { ) { val traceCookie = viewHolder.hashCode() val traceCookie = viewHolder.hashCode() Loading @@ -424,13 +422,8 @@ object MediaControlViewBinder { viewController.isArtworkBound = false viewController.isArtworkBound = false } } // Capture width & height from views in foreground for artwork scaling in background // Capture width & height from views in foreground for artwork scaling in background var width = viewHolder.albumView.measuredWidth val width = viewController.widthInSceneContainerPx var height = viewHolder.albumView.measuredHeight val height = viewController.heightInSceneContainerPx 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 } withContext(backgroundDispatcher) { withContext(backgroundDispatcher) { val artwork = val artwork = if (viewModel.shouldAddGradient) { if (viewModel.shouldAddGradient) { Loading @@ -449,6 +442,11 @@ object MediaControlViewBinder { val colorSchemeChanged = val colorSchemeChanged = viewController.colorSchemeTransition.updateColorScheme(viewModel.colorScheme) viewController.colorSchemeTransition.updateColorScheme(viewModel.colorScheme) val albumView = viewHolder.albumView 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) albumView.setPadding(0, 0, 0, 0) if ( if ( updateBackground || updateBackground || Loading