Merge "Calculate the position from start bounds for auto-enter PiP" into sc-dev
This commit is contained in:
commit
5a2a6e7325
|
@ -298,16 +298,16 @@ public class SwipePipToHomeAnimator extends ValueAnimator {
|
||||||
final float degree, positionX, positionY;
|
final float degree, positionX, positionY;
|
||||||
if (mFromRotation == Surface.ROTATION_90) {
|
if (mFromRotation == Surface.ROTATION_90) {
|
||||||
degree = -90 * fraction;
|
degree = -90 * fraction;
|
||||||
positionX = fraction * (mDestinationBoundsTransformed.left - mAppBounds.left)
|
positionX = fraction * (mDestinationBoundsTransformed.left - mStartBounds.left)
|
||||||
+ mAppBounds.left;
|
+ mStartBounds.left;
|
||||||
positionY = fraction * (mDestinationBoundsTransformed.bottom - mAppBounds.top)
|
positionY = fraction * (mDestinationBoundsTransformed.bottom - mStartBounds.top)
|
||||||
+ mAppBounds.top;
|
+ mStartBounds.top;
|
||||||
} else {
|
} else {
|
||||||
degree = 90 * fraction;
|
degree = 90 * fraction;
|
||||||
positionX = fraction * (mDestinationBoundsTransformed.right - mAppBounds.left)
|
positionX = fraction * (mDestinationBoundsTransformed.right - mStartBounds.left)
|
||||||
+ mAppBounds.left;
|
+ mStartBounds.left;
|
||||||
positionY = fraction * (mDestinationBoundsTransformed.top - mAppBounds.top)
|
positionY = fraction * (mDestinationBoundsTransformed.top - mStartBounds.top)
|
||||||
+ mAppBounds.top;
|
+ mStartBounds.top;
|
||||||
}
|
}
|
||||||
return new RotatedPosition(degree, positionX, positionY);
|
return new RotatedPosition(degree, positionX, positionY);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue