diff options
author | Tony <twickham@google.com> | 2019-05-13 15:47:45 -0500 |
---|---|---|
committer | Tony <twickham@google.com> | 2019-05-17 16:23:07 -0400 |
commit | 1eb65b8a5b99c4732d7190219d475455e386df26 (patch) | |
tree | 589a436a297127743df0516744b772a41647ade5 /quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java | |
parent | 5406817028c7d4175d9e190e67e3bbd87ca4f5de (diff) | |
download | android_packages_apps_Trebuchet-1eb65b8a5b99c4732d7190219d475455e386df26.tar.gz android_packages_apps_Trebuchet-1eb65b8a5b99c4732d7190219d475455e386df26.tar.bz2 android_packages_apps_Trebuchet-1eb65b8a5b99c4732d7190219d475455e386df26.zip |
Remove TaskViewDrawable, scale RecentsView instead
Instead of faking recents scaling up when swiping down on a task,
actually scale it up. This is more consistent with what we do
for scaling to/from fullscreen elsewhere, and cleans up some code.
Bug: 130020567
Change-Id: I1a07813468d9a66f8f4e7b5d3d9a191b565f165c
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java index a650113d5..c164a2450 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java @@ -285,13 +285,20 @@ public class ClipAnimationHelper { /** * Compute scale and translation y such that the specified task view fills the screen. */ - public LauncherState.ScaleAndTranslation getOverviewFullscreenScaleAndTranslation(TaskView v) { + public ClipAnimationHelper updateForFullscreenOverview(TaskView v) { TaskThumbnailView thumbnailView = v.getThumbnail(); RecentsView recentsView = v.getRecentsView(); fromTaskThumbnailView(thumbnailView, recentsView); Rect taskSize = new Rect(); recentsView.getTaskSize(taskSize); updateTargetRect(taskSize); + return this; + } + + /** + * @return The source rect's scale and translation relative to the target rect. + */ + public LauncherState.ScaleAndTranslation getScaleAndTranslation() { float scale = mSourceRect.width() / mTargetRect.width(); float translationY = mSourceRect.centerY() - mSourceRect.top - mTargetRect.centerY(); return new LauncherState.ScaleAndTranslation(scale, 0, translationY); @@ -332,35 +339,10 @@ public class ClipAnimationHelper { mSourceStackBounds.offset(left, insets.top + fullDp.availableHeightPx - taskHeight); } - public void drawForProgress(TaskThumbnailView ttv, Canvas canvas, float progress) { - RectF currentRect = mRectFEvaluator.evaluate(progress, mSourceRect, mTargetRect); - canvas.translate(mSourceStackBounds.left - mHomeStackBounds.left, - mSourceStackBounds.top - mHomeStackBounds.top); - mTmpMatrix.setRectToRect(mTargetRect, currentRect, ScaleToFit.FILL); - - canvas.concat(mTmpMatrix); - canvas.translate(mTargetRect.left, mTargetRect.top); - - float scale = mTargetRect.width() / mSourceRect.width(); - float insetProgress = (1 - progress); - float windowCornerRadius = mUseRoundedCornersOnWindows - ? mWindowCornerRadius : 0; - ttv.drawOnCanvas(canvas, - -mSourceWindowClipInsets.left * insetProgress, - -mSourceWindowClipInsets.top * insetProgress, - ttv.getMeasuredWidth() + mSourceWindowClipInsets.right * insetProgress, - ttv.getMeasuredHeight() + mSourceWindowClipInsets.bottom * insetProgress, - Utilities.mapRange(progress, windowCornerRadius * scale, ttv.getCornerRadius())); - } - public RectF getTargetRect() { return mTargetRect; } - public RectF getSourceRect() { - return mSourceRect; - } - public float getCurrentCornerRadius() { return mCurrentCornerRadius; } |