summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hawkwood Glazier <jglazier@google.com> 2022-11-29 16:07:38 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-11-29 16:07:38 +0000
commit14b6a72140b34fc9dc9b547238e637fc9498816f (patch)
tree9cc1b3e623767300a190541eef046fbd5157ee2d
parent93fd3686a0943fa27babe9c080bd0c7b1e7a92a6 (diff)
parenta8b8ec657b8e06e0a1bf70e23c88db5ed169a1b5 (diff)
Merge "Ensure final height of UMO transition is the hostView's height" into tm-qpr-dev am: a8b8ec657b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20552310 Change-Id: Ic233536585108b60360638739a71148e45e4b487 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaViewController.kt4
2 files changed, 5 insertions, 12 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt
index b252be1b4cdc..f7a9bc760caf 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaHierarchyManager.kt
@@ -1053,18 +1053,9 @@ constructor(
rootOverlay!!.add(mediaFrame)
} else {
val targetHost = getHost(newLocation)!!.hostView
- // When adding back to the host, let's make sure to reset the bounds.
- // Usually adding the view will trigger a layout that does this automatically,
- // but we sometimes suppress this.
+ // This will either do a full layout pass and remeasure, or it will bypass
+ // that and directly set the mediaFrame's bounds within the premeasured host.
targetHost.addView(mediaFrame)
- val left = targetHost.paddingLeft
- val top = targetHost.paddingTop
- mediaFrame.setLeftTopRightBottom(
- left,
- top,
- left + currentBounds.width(),
- top + currentBounds.height()
- )
if (mediaFrame.childCount > 0) {
val child = mediaFrame.getChildAt(0)
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaViewController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaViewController.kt
index 4bf3031c02b4..4feb9844cb8b 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaViewController.kt
@@ -420,7 +420,9 @@ constructor(
*/
fun getMeasurementsForState(hostState: MediaHostState): MeasurementOutput? =
traceSection("MediaViewController#getMeasurementsForState") {
- val viewState = obtainViewState(hostState) ?: return null
+ // measurements should never factor in the squish fraction
+ val viewState =
+ obtainViewState(hostState.copy().also { it.squishFraction = 1.0f }) ?: return null
measurement.measuredWidth = viewState.width
measurement.measuredHeight = viewState.height
return measurement