Merge "Fix bubble position with IME when the bubble has a custom height" into tm-dev am: 71163eeeb3

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

Change-Id: I093c8a808e677bb575d3c0405abdef00240476d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Mady Mellor
2022-04-11 18:52:35 +00:00
committed by Automerger Merge Worker
2 changed files with 16 additions and 0 deletions

View File

@@ -112,6 +112,7 @@ public class BubbleExpandedView extends LinearLayout {
private ShapeDrawable mRightPointer; private ShapeDrawable mRightPointer;
private float mCornerRadius = 0f; private float mCornerRadius = 0f;
private int mBackgroundColorFloating; private int mBackgroundColorFloating;
private boolean mUsingMaxHeight;
@Nullable private Bubble mBubble; @Nullable private Bubble mBubble;
private PendingIntent mPendingIntent; private PendingIntent mPendingIntent;
@@ -621,6 +622,13 @@ public class BubbleExpandedView extends LinearLayout {
return prevWasIntentBased != newIsIntentBased; return prevWasIntentBased != newIsIntentBased;
} }
/**
* Whether the bubble is using all available height to display or not.
*/
public boolean isUsingMaxHeight() {
return mUsingMaxHeight;
}
void updateHeight() { void updateHeight() {
if (mExpandedViewContainerLocation == null) { if (mExpandedViewContainerLocation == null) {
return; return;
@@ -632,6 +640,7 @@ public class BubbleExpandedView extends LinearLayout {
float height = desiredHeight == MAX_HEIGHT float height = desiredHeight == MAX_HEIGHT
? maxHeight ? maxHeight
: Math.min(desiredHeight, maxHeight); : Math.min(desiredHeight, maxHeight);
mUsingMaxHeight = height == maxHeight;
FrameLayout.LayoutParams lp = mIsOverflow FrameLayout.LayoutParams lp = mIsOverflow
? (FrameLayout.LayoutParams) mOverflowView.getLayoutParams() ? (FrameLayout.LayoutParams) mOverflowView.getLayoutParams()
: (FrameLayout.LayoutParams) mTaskView.getLayoutParams(); : (FrameLayout.LayoutParams) mTaskView.getLayoutParams();

View File

@@ -2355,7 +2355,14 @@ public class BubbleStackView extends FrameLayout
} }
} else if (mPositioner.showBubblesVertically() && mIsExpanded } else if (mPositioner.showBubblesVertically() && mIsExpanded
&& mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) { && mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
float selectedY = mPositioner.getExpandedBubbleXY(getState().selectedIndex,
getState()).y;
float newExpandedViewTop = mPositioner.getExpandedViewY(mExpandedBubble, selectedY);
mExpandedBubble.getExpandedView().setImeVisible(visible); mExpandedBubble.getExpandedView().setImeVisible(visible);
if (!mExpandedBubble.getExpandedView().isUsingMaxHeight()) {
mExpandedViewContainer.animate().translationY(newExpandedViewTop);
}
List<Animator> animList = new ArrayList(); List<Animator> animList = new ArrayList();
for (int i = 0; i < mBubbleContainer.getChildCount(); i++) { for (int i = 0; i < mBubbleContainer.getChildCount(); i++) {
View child = mBubbleContainer.getChildAt(i); View child = mBubbleContainer.getChildAt(i);