diff options
| author | 2020-06-17 20:40:42 +0000 | |
|---|---|---|
| committer | 2020-06-17 20:40:42 +0000 | |
| commit | 3e401ce43d444acd73fcb89f7e1497243d5b96de (patch) | |
| tree | 0157d18935c246b6d547a6d57d55008d12645e98 | |
| parent | c83b1a43f33ca78b9e5de3df00efa4adc7dd541c (diff) | |
| parent | d0e74868abe6935ad5e1884a8ae47e188a19da76 (diff) | |
Merge "Fix issues with landscape transition" into rvc-dev am: f769298b62 am: 7ea1586752 am: d0e74868ab
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11848935
Change-Id: I79807a9890cffdd9b4c42c7aeb7f625f9228c2fa
3 files changed, 25 insertions, 27 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java index eac06ea97a7e..959130bbdd0f 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExpandedView.java @@ -668,7 +668,7 @@ public class BubbleExpandedView extends LinearLayout { desiredHeight = Math.max(mBubble.getDesiredHeight(mContext), mMinHeight); } float height = Math.min(desiredHeight, getMaxExpandedHeight()); - height = Math.max(height, mIsOverflow? mOverflowHeight : mMinHeight); + height = Math.max(height, mMinHeight); ViewGroup.LayoutParams lp = mActivityView.getLayoutParams(); mNeedsNewHeight = lp.height != height; if (!mKeyboardVisible) { diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java index fa97bd7b7a5e..297d92e3135f 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java @@ -889,14 +889,7 @@ public class BubbleStackView extends FrameLayout (v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> { mExpandedAnimationController.updateResources(mOrientation, mDisplaySize); mStackAnimationController.updateResources(mOrientation); - - // Reposition & adjust the height for new orientation - if (mIsExpanded) { - mExpandedViewContainer.setTranslationY(getExpandedViewY()); - if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) { - mExpandedBubble.getExpandedView().updateView(getLocationOnScreen()); - } - } + mBubbleOverflow.updateDimensions(); // Need to update the padding around the view WindowInsets insets = getRootWindowInsets(); @@ -920,9 +913,15 @@ public class BubbleStackView extends FrameLayout if (mIsExpanded) { // Re-draw bubble row and pointer for new orientation. + beforeExpandedViewAnimation(); + updateOverflowVisibility(); + updatePointerPosition(); mExpandedAnimationController.expandFromStack(() -> { - updatePointerPosition(); + afterExpandedViewAnimation(); } /* after */); + mExpandedViewContainer.setTranslationX(0); + mExpandedViewContainer.setTranslationY(getExpandedViewY()); + mExpandedViewContainer.setAlpha(1f); } if (mVerticalPosPercentBeforeRotation >= 0) { mStackAnimationController.moveStackToSimilarPositionAfterRotation( diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java b/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java index cb8995a72dc3..8e232520a196 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/animation/ExpandedAnimationController.java @@ -203,12 +203,22 @@ public class ExpandedAnimationController public void updateResources(int orientation, Point displaySize) { mScreenOrientation = orientation; mDisplaySize = displaySize; - if (mLayout != null) { - Resources res = mLayout.getContext().getResources(); - mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top); - mStatusBarHeight = res.getDimensionPixelSize( - com.android.internal.R.dimen.status_bar_height); + if (mLayout == null) { + return; } + Resources res = mLayout.getContext().getResources(); + mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top); + mStatusBarHeight = res.getDimensionPixelSize( + com.android.internal.R.dimen.status_bar_height); + mStackOffsetPx = res.getDimensionPixelSize(R.dimen.bubble_stack_offset); + mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top); + mBubbleSizePx = res.getDimensionPixelSize(R.dimen.individual_bubble_size); + mBubblesMaxRendered = res.getInteger(R.integer.bubbles_max_rendered); + + // Includes overflow button. + float totalGapWidth = getWidthForDisplayingBubbles() - (mExpandedViewPadding * 2) + - (mBubblesMaxRendered + 1) * mBubbleSizePx; + mSpaceBetweenBubbles = totalGapWidth / mBubblesMaxRendered; } /** @@ -464,18 +474,7 @@ public class ExpandedAnimationController @Override void onActiveControllerForLayout(PhysicsAnimationLayout layout) { - final Resources res = layout.getResources(); - mStackOffsetPx = res.getDimensionPixelSize(R.dimen.bubble_stack_offset); - mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top); - mBubbleSizePx = res.getDimensionPixelSize(R.dimen.individual_bubble_size); - mStatusBarHeight = - res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_height); - mBubblesMaxRendered = res.getInteger(R.integer.bubbles_max_rendered); - - // Includes overflow button. - float totalGapWidth = getWidthForDisplayingBubbles() - (mExpandedViewPadding * 2) - - (mBubblesMaxRendered + 1) * mBubbleSizePx; - mSpaceBetweenBubbles = totalGapWidth / mBubblesMaxRendered; + updateResources(mScreenOrientation, mDisplaySize); // Ensure that all child views are at 1x scale, and visible, in case they were animating // in. |