Merge "2D Recents: Fix issues with thumbnail scaling transitions" into nyc-mr2-dev
This commit is contained in:
@@ -733,11 +733,7 @@ public class RecentsImpl implements ActivityOptions.OnAnimationFinishedListener
|
|||||||
Task toTask = new Task();
|
Task toTask = new Task();
|
||||||
TaskViewTransform toTransform = getThumbnailTransitionTransform(stackView, toTask,
|
TaskViewTransform toTransform = getThumbnailTransitionTransform(stackView, toTask,
|
||||||
windowOverrideRect);
|
windowOverrideRect);
|
||||||
// When using a grid layout, the header is already visible on screen at the target
|
Bitmap thumbnail = drawThumbnailTransitionBitmap(toTask, toTransform,
|
||||||
// location, making it unnecessary to draw it in the transition thumbnail.
|
|
||||||
Bitmap thumbnail = stackView.useGridLayout()
|
|
||||||
? mThumbTransitionBitmapCache.createAshmemBitmap()
|
|
||||||
: drawThumbnailTransitionBitmap(toTask, toTransform,
|
|
||||||
mThumbTransitionBitmapCache);
|
mThumbTransitionBitmapCache);
|
||||||
if (thumbnail != null) {
|
if (thumbnail != null) {
|
||||||
RectF toTaskRect = toTransform.rect;
|
RectF toTaskRect = toTransform.rect;
|
||||||
|
|||||||
@@ -925,9 +925,9 @@ public class AppTransition implements Dump {
|
|||||||
float scaleW = appWidth / thumbWidth;
|
float scaleW = appWidth / thumbWidth;
|
||||||
getNextAppTransitionStartRect(taskId, mTmpRect);
|
getNextAppTransitionStartRect(taskId, mTmpRect);
|
||||||
final float fromX;
|
final float fromX;
|
||||||
final float fromY;
|
float fromY;
|
||||||
final float toX;
|
final float toX;
|
||||||
final float toY;
|
float toY;
|
||||||
final float pivotX;
|
final float pivotX;
|
||||||
final float pivotY;
|
final float pivotY;
|
||||||
if (shouldScaleDownThumbnailTransition(uiMode, orientation)) {
|
if (shouldScaleDownThumbnailTransition(uiMode, orientation)) {
|
||||||
@@ -940,6 +940,12 @@ public class AppTransition implements Dump {
|
|||||||
toY = appRect.height() / 2 * (1 - 1 / scaleW) + appRect.top;
|
toY = appRect.height() / 2 * (1 - 1 / scaleW) + appRect.top;
|
||||||
pivotX = mTmpRect.width() / 2;
|
pivotX = mTmpRect.width() / 2;
|
||||||
pivotY = appRect.height() / 2 / scaleW;
|
pivotY = appRect.height() / 2 / scaleW;
|
||||||
|
if (mGridLayoutRecentsEnabled) {
|
||||||
|
// In the grid layout, the header is displayed above the thumbnail instead of
|
||||||
|
// overlapping it.
|
||||||
|
fromY -= thumbHeightI;
|
||||||
|
toY -= thumbHeightI * scaleW;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
pivotX = 0;
|
pivotX = 0;
|
||||||
pivotY = 0;
|
pivotY = 0;
|
||||||
@@ -988,7 +994,10 @@ public class AppTransition implements Dump {
|
|||||||
// This AnimationSet uses the Interpolators assigned above.
|
// This AnimationSet uses the Interpolators assigned above.
|
||||||
AnimationSet set = new AnimationSet(false);
|
AnimationSet set = new AnimationSet(false);
|
||||||
set.addAnimation(scale);
|
set.addAnimation(scale);
|
||||||
|
if (!mGridLayoutRecentsEnabled) {
|
||||||
|
// In the grid layout, the header should be shown for the whole animation.
|
||||||
set.addAnimation(alpha);
|
set.addAnimation(alpha);
|
||||||
|
}
|
||||||
set.addAnimation(translate);
|
set.addAnimation(translate);
|
||||||
set.addAnimation(clipAnim);
|
set.addAnimation(clipAnim);
|
||||||
a = set;
|
a = set;
|
||||||
@@ -1007,7 +1016,10 @@ public class AppTransition implements Dump {
|
|||||||
// This AnimationSet uses the Interpolators assigned above.
|
// This AnimationSet uses the Interpolators assigned above.
|
||||||
AnimationSet set = new AnimationSet(false);
|
AnimationSet set = new AnimationSet(false);
|
||||||
set.addAnimation(scale);
|
set.addAnimation(scale);
|
||||||
|
if (!mGridLayoutRecentsEnabled) {
|
||||||
|
// In the grid layout, the header should be shown for the whole animation.
|
||||||
set.addAnimation(alpha);
|
set.addAnimation(alpha);
|
||||||
|
}
|
||||||
set.addAnimation(translate);
|
set.addAnimation(translate);
|
||||||
a = set;
|
a = set;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user