Merge "Ensures display rotation triggers PiP re-position" into rvc-dev am: abe2fed8b0
Change-Id: Ibd9c220dc2e8aeaa3c37d898e7a16c5042659cb4
This commit is contained in:
@@ -341,7 +341,10 @@ public class PipManager implements BasePipManager, PipTaskOrganizer.PipTransitio
|
|||||||
|
|
||||||
private void updateMovementBounds(Rect animatingBounds, boolean fromImeAdjustment,
|
private void updateMovementBounds(Rect animatingBounds, boolean fromImeAdjustment,
|
||||||
boolean fromShelfAdjustment) {
|
boolean fromShelfAdjustment) {
|
||||||
// Populate inset / normal bounds and DisplayInfo from mPipBoundsHandler first.
|
mPipTaskOrganizer.onDisplayInfoChanged(mTmpDisplayInfo);
|
||||||
|
// Populate inset / normal bounds and DisplayInfo from mPipBoundsHandler before
|
||||||
|
// passing to mTouchHandler, mTouchHandler would rely on the bounds calculated by
|
||||||
|
// mPipBoundsHandler with up-to-dated information
|
||||||
mPipBoundsHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds,
|
mPipBoundsHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds,
|
||||||
animatingBounds, mTmpDisplayInfo);
|
animatingBounds, mTmpDisplayInfo);
|
||||||
mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds,
|
mTouchHandler.onMovementBoundsChanged(mTmpInsetBounds, mTmpNormalBounds,
|
||||||
|
|||||||
@@ -411,11 +411,9 @@ public class PipMotionHelper implements Handler.Callback, PipAppOpsListener.Call
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void adjustAndAnimatePipOffset(Rect originalBounds, int offset, int duration) {
|
private void adjustAndAnimatePipOffset(Rect originalBounds, int offset, int duration) {
|
||||||
if (offset == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SomeArgs args = SomeArgs.obtain();
|
SomeArgs args = SomeArgs.obtain();
|
||||||
args.arg1 = originalBounds;
|
args.arg1 = originalBounds;
|
||||||
|
// offset would be zero if triggered from screen rotation.
|
||||||
args.argi1 = offset;
|
args.argi1 = offset;
|
||||||
args.argi2 = duration;
|
args.argi2 = duration;
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_OFFSET_ANIMATE, args));
|
mHandler.sendMessage(mHandler.obtainMessage(MSG_OFFSET_ANIMATE, args));
|
||||||
|
|||||||
@@ -269,6 +269,10 @@ public class PipTouchHandler {
|
|||||||
public void onMovementBoundsChanged(Rect insetBounds, Rect normalBounds, Rect curBounds,
|
public void onMovementBoundsChanged(Rect insetBounds, Rect normalBounds, Rect curBounds,
|
||||||
boolean fromImeAdjustment, boolean fromShelfAdjustment, int displayRotation) {
|
boolean fromImeAdjustment, boolean fromShelfAdjustment, int displayRotation) {
|
||||||
final int bottomOffset = mIsImeShowing ? mImeHeight : 0;
|
final int bottomOffset = mIsImeShowing ? mImeHeight : 0;
|
||||||
|
final boolean fromDisplayRotationChanged = (mDisplayRotation != displayRotation);
|
||||||
|
if (fromDisplayRotationChanged) {
|
||||||
|
mTouchState.reset();
|
||||||
|
}
|
||||||
|
|
||||||
// Re-calculate the expanded bounds
|
// Re-calculate the expanded bounds
|
||||||
mNormalBounds = normalBounds;
|
mNormalBounds = normalBounds;
|
||||||
@@ -296,7 +300,7 @@ public class PipTouchHandler {
|
|||||||
|
|
||||||
// If this is from an IME or shelf adjustment, then we should move the PiP so that it is not
|
// If this is from an IME or shelf adjustment, then we should move the PiP so that it is not
|
||||||
// occluded by the IME or shelf.
|
// occluded by the IME or shelf.
|
||||||
if (fromImeAdjustment || fromShelfAdjustment) {
|
if (fromImeAdjustment || fromShelfAdjustment || fromDisplayRotationChanged) {
|
||||||
if (mTouchState.isUserInteracting()) {
|
if (mTouchState.isUserInteracting()) {
|
||||||
// Defer the update of the current movement bounds until after the user finishes
|
// Defer the update of the current movement bounds until after the user finishes
|
||||||
// touching the screen
|
// touching the screen
|
||||||
|
|||||||
Reference in New Issue
Block a user