Loading packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +2 −0 Original line number Diff line number Diff line Loading @@ -956,6 +956,8 @@ public class BubbleStackView extends FrameLayout { mVerticalPosPercentBeforeRotation = (mStackAnimationController.getStackPosition().y - allowablePos.top) / (allowablePos.bottom - allowablePos.top); mVerticalPosPercentBeforeRotation = Math.max(0f, Math.min(1f, mVerticalPosPercentBeforeRotation)); addOnLayoutChangeListener(mOrientationChangedListener); hideFlyoutImmediate(); } Loading packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, void synchronizePinnedStackBounds() { cancelAnimations(); mBounds.set(mPipTaskOrganizer.getLastReportedBounds()); mFloatingContentCoordinator.onContentMoved(this); } /** Loading packages/SystemUI/src/com/android/systemui/util/FloatingContentCoordinator.kt +26 −13 Original line number Diff line number Diff line Loading @@ -187,17 +187,24 @@ class FloatingContentCoordinator @Inject constructor() { // Tell that content to get out of the way, and save the bounds it says it's moving // (or animating) to. .forEach { (content, bounds) -> content.moveToBounds( content.calculateNewBoundsOnOverlap( val newBounds = content.calculateNewBoundsOnOverlap( conflictingNewBounds, // Pass all of the content bounds except the bounds of the // content we're asking to move, and the conflicting new bounds // (since those are passed separately). otherContentBounds = allContentBounds.values .minus(bounds) .minus(conflictingNewBounds))) .minus(conflictingNewBounds)) // If the new bounds are empty, it means there's no non-overlapping position // that is in bounds. Just leave the content where it is. This should normally // not happen, but sometimes content like PIP reports incorrect bounds // temporarily. if (!newBounds.isEmpty) { content.moveToBounds(newBounds) allContentBounds[content] = content.getFloatingBoundsOnScreen() } } currentlyResolvingConflicts = false } Loading Loading @@ -229,8 +236,8 @@ class FloatingContentCoordinator @Inject constructor() { * @param allowedBounds The area within which we're allowed to find new bounds for the * content. * @return New bounds for the content that don't intersect the exclusion rects or the * newly overlapping rect, and that is within bounds unless no possible in-bounds position * exists. * newly overlapping rect, and that is within bounds - or an empty Rect if no in-bounds * position exists. */ @JvmStatic fun findAreaForContentVertically( Loading Loading @@ -274,7 +281,13 @@ class FloatingContentCoordinator @Inject constructor() { !overlappingContentPushingDown && !positionAboveInBounds // Return the content rect, but offset to reflect the new position. return if (usePositionBelow) newContentBoundsBelow else newContentBoundsAbove val newBounds = if (usePositionBelow) newContentBoundsBelow else newContentBoundsAbove // If the new bounds are within the allowed bounds, return them. If not, it means that // there are no legal new bounds. This can happen if the new content's bounds are too // large (for example, full-screen PIP). Since there is no reasonable action to take // here, return an empty Rect and we will just not move the content. return if (allowedBounds.contains(newBounds)) newBounds else Rect() } /** Loading Loading
packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +2 −0 Original line number Diff line number Diff line Loading @@ -956,6 +956,8 @@ public class BubbleStackView extends FrameLayout { mVerticalPosPercentBeforeRotation = (mStackAnimationController.getStackPosition().y - allowablePos.top) / (allowablePos.bottom - allowablePos.top); mVerticalPosPercentBeforeRotation = Math.max(0f, Math.min(1f, mVerticalPosPercentBeforeRotation)); addOnLayoutChangeListener(mOrientationChangedListener); hideFlyoutImmediate(); } Loading
packages/SystemUI/src/com/android/systemui/pip/phone/PipMotionHelper.java +1 −0 Original line number Diff line number Diff line Loading @@ -168,6 +168,7 @@ public class PipMotionHelper implements PipAppOpsListener.Callback, void synchronizePinnedStackBounds() { cancelAnimations(); mBounds.set(mPipTaskOrganizer.getLastReportedBounds()); mFloatingContentCoordinator.onContentMoved(this); } /** Loading
packages/SystemUI/src/com/android/systemui/util/FloatingContentCoordinator.kt +26 −13 Original line number Diff line number Diff line Loading @@ -187,17 +187,24 @@ class FloatingContentCoordinator @Inject constructor() { // Tell that content to get out of the way, and save the bounds it says it's moving // (or animating) to. .forEach { (content, bounds) -> content.moveToBounds( content.calculateNewBoundsOnOverlap( val newBounds = content.calculateNewBoundsOnOverlap( conflictingNewBounds, // Pass all of the content bounds except the bounds of the // content we're asking to move, and the conflicting new bounds // (since those are passed separately). otherContentBounds = allContentBounds.values .minus(bounds) .minus(conflictingNewBounds))) .minus(conflictingNewBounds)) // If the new bounds are empty, it means there's no non-overlapping position // that is in bounds. Just leave the content where it is. This should normally // not happen, but sometimes content like PIP reports incorrect bounds // temporarily. if (!newBounds.isEmpty) { content.moveToBounds(newBounds) allContentBounds[content] = content.getFloatingBoundsOnScreen() } } currentlyResolvingConflicts = false } Loading Loading @@ -229,8 +236,8 @@ class FloatingContentCoordinator @Inject constructor() { * @param allowedBounds The area within which we're allowed to find new bounds for the * content. * @return New bounds for the content that don't intersect the exclusion rects or the * newly overlapping rect, and that is within bounds unless no possible in-bounds position * exists. * newly overlapping rect, and that is within bounds - or an empty Rect if no in-bounds * position exists. */ @JvmStatic fun findAreaForContentVertically( Loading Loading @@ -274,7 +281,13 @@ class FloatingContentCoordinator @Inject constructor() { !overlappingContentPushingDown && !positionAboveInBounds // Return the content rect, but offset to reflect the new position. return if (usePositionBelow) newContentBoundsBelow else newContentBoundsAbove val newBounds = if (usePositionBelow) newContentBoundsBelow else newContentBoundsAbove // If the new bounds are within the allowed bounds, return them. If not, it means that // there are no legal new bounds. This can happen if the new content's bounds are too // large (for example, full-screen PIP). Since there is no reasonable action to take // here, return an empty Rect and we will just not move the content. return if (allowedBounds.contains(newBounds)) newBounds else Rect() } /** Loading