Merge "Fix bubble expanded view jumping to the left when switching bubbles" into tm-dev am: 3d69ea8e74

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17767631

Change-Id: I27aa61146863bcd166d188ca537f6f6732faeb8b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-04-15 04:46:41 +00:00
committed by Automerger Merge Worker
2 changed files with 10 additions and 2 deletions

View File

@@ -329,6 +329,11 @@ public class BubblePositioner {
: mBubbleSize; : mBubbleSize;
} }
/** Size of the visible (non-overlapping) part of the pointer. */
public int getPointerSize() {
return mPointerHeight - mPointerOverlap;
}
/** The maximum number of bubbles that can be displayed comfortably on screen. */ /** The maximum number of bubbles that can be displayed comfortably on screen. */
public int getMaxBubbles() { public int getMaxBubbles() {
return mMaxBubbles; return mMaxBubbles;
@@ -367,7 +372,7 @@ public class BubblePositioner {
* padding is added. * padding is added.
*/ */
public int[] getExpandedViewContainerPadding(boolean onLeft, boolean isOverflow) { public int[] getExpandedViewContainerPadding(boolean onLeft, boolean isOverflow) {
final int pointerTotalHeight = mPointerHeight - mPointerOverlap; final int pointerTotalHeight = getPointerSize();
final int expandedViewLargeScreenInsetFurthestEdge = final int expandedViewLargeScreenInsetFurthestEdge =
getExpandedViewLargeScreenInsetFurthestEdge(isOverflow); getExpandedViewLargeScreenInsetFurthestEdge(isOverflow);
if (mIsLargeScreen) { if (mIsLargeScreen) {

View File

@@ -2887,7 +2887,10 @@ public class BubbleStackView extends FrameLayout
PhysicsAnimator.getInstance(mAnimatingOutSurfaceContainer).cancel(); PhysicsAnimator.getInstance(mAnimatingOutSurfaceContainer).cancel();
mAnimatingOutSurfaceContainer.setScaleX(1f); mAnimatingOutSurfaceContainer.setScaleX(1f);
mAnimatingOutSurfaceContainer.setScaleY(1f); mAnimatingOutSurfaceContainer.setScaleY(1f);
mAnimatingOutSurfaceContainer.setTranslationX(mExpandedViewContainer.getPaddingLeft()); final float translationX = mPositioner.showBubblesVertically() && mStackOnLeftOrWillBe
? mExpandedViewContainer.getPaddingLeft() + mPositioner.getPointerSize()
: mExpandedViewContainer.getPaddingLeft();
mAnimatingOutSurfaceContainer.setTranslationX(translationX);
mAnimatingOutSurfaceContainer.setTranslationY(0); mAnimatingOutSurfaceContainer.setTranslationY(0);
final int[] taskViewLocation = final int[] taskViewLocation =