Merge "Fix issues with landscape transition" into rvc-dev am: f769298b62 am: 1592315431
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11848935 Change-Id: Ieabe887a9e22cb2c29ccf18910bbbfe2818b90e8
This commit is contained in:
@@ -668,7 +668,7 @@ public class BubbleExpandedView extends LinearLayout {
|
|||||||
desiredHeight = Math.max(mBubble.getDesiredHeight(mContext), mMinHeight);
|
desiredHeight = Math.max(mBubble.getDesiredHeight(mContext), mMinHeight);
|
||||||
}
|
}
|
||||||
float height = Math.min(desiredHeight, getMaxExpandedHeight());
|
float height = Math.min(desiredHeight, getMaxExpandedHeight());
|
||||||
height = Math.max(height, mIsOverflow? mOverflowHeight : mMinHeight);
|
height = Math.max(height, mMinHeight);
|
||||||
ViewGroup.LayoutParams lp = mActivityView.getLayoutParams();
|
ViewGroup.LayoutParams lp = mActivityView.getLayoutParams();
|
||||||
mNeedsNewHeight = lp.height != height;
|
mNeedsNewHeight = lp.height != height;
|
||||||
if (!mKeyboardVisible) {
|
if (!mKeyboardVisible) {
|
||||||
|
|||||||
@@ -889,14 +889,7 @@ public class BubbleStackView extends FrameLayout
|
|||||||
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
||||||
mExpandedAnimationController.updateResources(mOrientation, mDisplaySize);
|
mExpandedAnimationController.updateResources(mOrientation, mDisplaySize);
|
||||||
mStackAnimationController.updateResources(mOrientation);
|
mStackAnimationController.updateResources(mOrientation);
|
||||||
|
mBubbleOverflow.updateDimensions();
|
||||||
// Reposition & adjust the height for new orientation
|
|
||||||
if (mIsExpanded) {
|
|
||||||
mExpandedViewContainer.setTranslationY(getExpandedViewY());
|
|
||||||
if (mExpandedBubble != null && mExpandedBubble.getExpandedView() != null) {
|
|
||||||
mExpandedBubble.getExpandedView().updateView(getLocationOnScreen());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Need to update the padding around the view
|
// Need to update the padding around the view
|
||||||
WindowInsets insets = getRootWindowInsets();
|
WindowInsets insets = getRootWindowInsets();
|
||||||
@@ -920,9 +913,15 @@ public class BubbleStackView extends FrameLayout
|
|||||||
|
|
||||||
if (mIsExpanded) {
|
if (mIsExpanded) {
|
||||||
// Re-draw bubble row and pointer for new orientation.
|
// Re-draw bubble row and pointer for new orientation.
|
||||||
|
beforeExpandedViewAnimation();
|
||||||
|
updateOverflowVisibility();
|
||||||
|
updatePointerPosition();
|
||||||
mExpandedAnimationController.expandFromStack(() -> {
|
mExpandedAnimationController.expandFromStack(() -> {
|
||||||
updatePointerPosition();
|
afterExpandedViewAnimation();
|
||||||
} /* after */);
|
} /* after */);
|
||||||
|
mExpandedViewContainer.setTranslationX(0);
|
||||||
|
mExpandedViewContainer.setTranslationY(getExpandedViewY());
|
||||||
|
mExpandedViewContainer.setAlpha(1f);
|
||||||
}
|
}
|
||||||
if (mVerticalPosPercentBeforeRotation >= 0) {
|
if (mVerticalPosPercentBeforeRotation >= 0) {
|
||||||
mStackAnimationController.moveStackToSimilarPositionAfterRotation(
|
mStackAnimationController.moveStackToSimilarPositionAfterRotation(
|
||||||
|
|||||||
@@ -203,12 +203,22 @@ public class ExpandedAnimationController
|
|||||||
public void updateResources(int orientation, Point displaySize) {
|
public void updateResources(int orientation, Point displaySize) {
|
||||||
mScreenOrientation = orientation;
|
mScreenOrientation = orientation;
|
||||||
mDisplaySize = displaySize;
|
mDisplaySize = displaySize;
|
||||||
if (mLayout != null) {
|
if (mLayout == null) {
|
||||||
Resources res = mLayout.getContext().getResources();
|
return;
|
||||||
mBubblePaddingTop = res.getDimensionPixelSize(R.dimen.bubble_padding_top);
|
|
||||||
mStatusBarHeight = res.getDimensionPixelSize(
|
|
||||||
com.android.internal.R.dimen.status_bar_height);
|
|
||||||
}
|
}
|
||||||
|
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
|
@Override
|
||||||
void onActiveControllerForLayout(PhysicsAnimationLayout layout) {
|
void onActiveControllerForLayout(PhysicsAnimationLayout layout) {
|
||||||
final Resources res = layout.getResources();
|
updateResources(mScreenOrientation, mDisplaySize);
|
||||||
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;
|
|
||||||
|
|
||||||
// Ensure that all child views are at 1x scale, and visible, in case they were animating
|
// Ensure that all child views are at 1x scale, and visible, in case they were animating
|
||||||
// in.
|
// in.
|
||||||
|
|||||||
Reference in New Issue
Block a user