summaryrefslogtreecommitdiff
path: root/quickstep
diff options
context:
space:
mode:
authorVinit Nayak <peanutbutter@google.com>2022-02-14 19:03:08 -0800
committerVinit Nayak <peanutbutter@google.com>2022-02-15 12:01:37 -0800
commit181f4b2c4006fc5cb2be62cc3188cee03756c72c (patch)
treea8fd5ad6034454a0f075ffa47e7093f9728ad98c /quickstep
parentb70131e1ddc2b68a86c8aee9f85bfc394afb1f4a (diff)
downloadLauncher3-181f4b2c4006fc5cb2be62cc3188cee03756c72c.tar.gz
Ensure starting split animation scale is always 1
Bug: 194414938 Test: After second app selected, first split placeholder view doesn't jumpcut to arbitrary Y bounds. Change-Id: Ic8b809f147bf38f78198ef4224d810faf5e3c5ba
Diffstat (limited to 'quickstep')
-rw-r--r--quickstep/src/com/android/quickstep/views/FloatingTaskView.java21
-rw-r--r--quickstep/src/com/android/quickstep/views/RecentsView.java9
2 files changed, 12 insertions, 18 deletions
diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
index 9ae5d250b8..bee1c1a3df 100644
--- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
+++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java
@@ -176,13 +176,12 @@ public class FloatingTaskView extends FrameLayout {
}
public void addAnimation(PendingAnimation animation, RectF startingBounds, Rect endBounds,
- View viewToCover, boolean fadeWithThumbnail) {
+ boolean fadeWithThumbnail) {
final BaseDragLayer dragLayer = mActivity.getDragLayer();
int[] dragLayerBounds = new int[2];
dragLayer.getLocationOnScreen(dragLayerBounds);
SplitOverlayProperties prop = new SplitOverlayProperties(endBounds,
- startingBounds, viewToCover, dragLayerBounds[0],
- dragLayerBounds[1]);
+ startingBounds, dragLayerBounds[0], dragLayerBounds[1]);
ValueAnimator transitionAnimator = ValueAnimator.ofFloat(0, 1);
animation.add(transitionAnimator);
@@ -205,10 +204,10 @@ public class FloatingTaskView extends FrameLayout {
initialWindowRadius, 0, animDuration, LINEAR);
final FloatProp mDx = new FloatProp(0, prop.dX, 0, animDuration, LINEAR);
final FloatProp mDy = new FloatProp(0, prop.dY, 0, animDuration, LINEAR);
- final FloatProp mTaskViewScaleX = new FloatProp(prop.initialTaskViewScaleX,
- prop.finalTaskViewScaleX, 0, animDuration, LINEAR);
- final FloatProp mTaskViewScaleY = new FloatProp(prop.initialTaskViewScaleY,
- prop.finalTaskViewScaleY, 0, animDuration, LINEAR);
+ final FloatProp mTaskViewScaleX = new FloatProp(1f, prop.finalTaskViewScaleX, 0,
+ animDuration, LINEAR);
+ final FloatProp mTaskViewScaleY = new FloatProp(1f, prop.finalTaskViewScaleY, 0,
+ animDuration, LINEAR);
@Override
public void onUpdate(float percent, boolean initOnly) {
// Calculate the icon position.
@@ -225,24 +224,20 @@ public class FloatingTaskView extends FrameLayout {
private static class SplitOverlayProperties {
- private final float initialTaskViewScaleX;
- private final float initialTaskViewScaleY;
private final float finalTaskViewScaleX;
private final float finalTaskViewScaleY;
private final float dX;
private final float dY;
- SplitOverlayProperties(Rect endBounds, RectF startTaskViewBounds, View view,
+ SplitOverlayProperties(Rect endBounds, RectF startTaskViewBounds,
int dragLayerLeft, int dragLayerTop) {
float maxScaleX = endBounds.width() / startTaskViewBounds.width();
float maxScaleY = endBounds.height() / startTaskViewBounds.height();
- initialTaskViewScaleX = view.getScaleX();
- initialTaskViewScaleY = view.getScaleY();
finalTaskViewScaleX = maxScaleX;
finalTaskViewScaleY = maxScaleY;
- // Animate the app icon to the center of the window bounds in screen coordinates.
+ // Animate to the center of the window bounds in screen coordinates.
float centerX = endBounds.centerX() - dragLayerLeft;
float centerY = endBounds.centerY() - dragLayerTop;
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 2a2d1dde3e..3450b7c31f 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -2727,7 +2727,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitHiddenTaskView.getIconView().getDrawable(), startingTaskRect);
mFirstFloatingTaskView.setAlpha(1);
mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
- mTempRect, mSplitHiddenTaskView, true /*fadeWithThumbnail*/);
+ mTempRect, true /*fadeWithThumbnail*/);
} else {
mSplitSelectSource.view.setVisibility(INVISIBLE);
mFirstFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
@@ -2735,7 +2735,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mSplitSelectSource.drawable, startingTaskRect);
mFirstFloatingTaskView.setAlpha(1);
mFirstFloatingTaskView.addAnimation(anim, startingTaskRect,
- mTempRect, mSplitSelectSource.view, true /*fadeWithThumbnail*/);
+ mTempRect, true /*fadeWithThumbnail*/);
}
anim.addEndListener(success -> {
if (success) {
@@ -4019,7 +4019,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
mFirstFloatingTaskView.getBoundsOnScreen(firstTaskStartingBounds);
mFirstFloatingTaskView.addAnimation(pendingAnimation,
- new RectF(firstTaskStartingBounds), firstTaskEndingBounds, mFirstFloatingTaskView,
+ new RectF(firstTaskStartingBounds), firstTaskEndingBounds,
false /*fadeWithThumbnail*/);
mSecondFloatingTaskView = FloatingTaskView.getFloatingTaskView(mActivity,
@@ -4027,8 +4027,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
taskView.getIconView().getDrawable(), secondTaskStartingBounds);
mSecondFloatingTaskView.setAlpha(1);
mSecondFloatingTaskView.addAnimation(pendingAnimation, secondTaskStartingBounds,
- secondTaskEndingBounds, taskView.getThumbnail(),
- true /*fadeWithThumbnail*/);
+ secondTaskEndingBounds, true /*fadeWithThumbnail*/);
pendingAnimation.addEndListener(aBoolean ->
mSplitSelectStateController.setSecondTaskId(taskView.getTask().key.id,
aBoolean1 -> RecentsView.this.resetFromSplitSelectionState()));