diff options
author | Winson Chung <winsonc@google.com> | 2019-07-18 11:36:39 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2019-07-18 11:36:39 -0700 |
commit | 5841e40a95b2d01386d83b83abeef9b150d833c5 (patch) | |
tree | 1f3ca207415e2360ba6d172754dcf43f29742e3e /quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java | |
parent | ea8fb85c75d5e5712316de1d85d431fb19aa5612 (diff) | |
parent | 11b5535556cc3d53d7e521715178ddcd4b708daf (diff) | |
download | android_packages_apps_Trebuchet-5841e40a95b2d01386d83b83abeef9b150d833c5.tar.gz android_packages_apps_Trebuchet-5841e40a95b2d01386d83b83abeef9b150d833c5.tar.bz2 android_packages_apps_Trebuchet-5841e40a95b2d01386d83b83abeef9b150d833c5.zip |
Merging ub-launcher3-qt-r1-dev, build 5736932
Test: Manual
Bug:111935715 P2 Incorrect parent type when logging drag and drop from All Apps
Bug:131315856 P1 [PO restore] No work profile launcher shortcuts restore ~50% of the time
Bug:132900132 P1 Apparently, tests start running while provisioning is still in progress
Bug:133009122 P2 Rare flake: dragged launchable to workspace, but the current state is not WORKSPACE; Can't find a launcher object; selector: BySelector [RES='\Qcom.google.android.apps.nexuslauncher:id/apps_view\E']
Bug:133765434 P1 [Flaky test] Launching task didn't open a new window
Bug:133867119 P2 Lab-only flake: want to switch from workspace to all apps; Swipe failed to receive an event for the swipe end
Bug:133891845 P2 TAPL: need clearer diags when a crash dialog is over Launcher or there is lock screeen
Bug:134532571 P1 Launcher flake: java.lang.AssertionError: http://go/tapl : want to switch from background to overview, but the current state is not BASE_OVERVIEW; Can't find a launcher object; selector: BySelector [RES='\Qcom.google.android.apps.nexuslauncher:id/overview_panel\E']
Bug:135165284 P2 [Q-Preview4] Gestural navigation animation glitch on RTL
Bug:135567630 P1 testBackground crashes in Landscape
Bug:135636137 P1 Workspace is clipped at the top when transitioning from app -> home
Bug:135687618 P4 Task shows between back and swiping up to overview
Bug:135952890 P1 Drag up on home indicator does not track finger if recently entered split screen
Bug:136033787 P0 Vzw DoU: sendexchangeemail wifi test fails with failed dismissal exception
Bug:136215685 P1 Flake: swiping up from Home to Overview in 2-button mode sometimes fails
Bug:137197916 P1 Add gesture support for 3p Launcher
Bug:137215697 P2 FloatingIcon and workspace icon visible at the same time when touch input during app to close animation
Bug:137290162 P1 Overview suggest chip showing on apps due to misconfigured flag
Bug:137316430 P1 Jank when swiping quickly back down to home when overview is peeking
Bug:64712476 P3 Import translations for dev branches
Change-Id: Ib228c0f291884050904fa069e25519755071c40a
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, 24 insertions, 10 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 6dc672ecf..90989feb4 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 @@ -99,8 +99,8 @@ public class ClipAnimationHelper { // Whether to boost the opening animation target layers, or the closing private int mBoostModeTargetLayers = -1; - private BiFunction<RemoteAnimationTargetCompat, Float, Float> mTaskAlphaCallback = - (t, a1) -> a1; + private TargetAlphaProvider mTaskAlphaCallback = (t, a) -> a; + private TargetAlphaProvider mBaseAlphaCallback = (t, a) -> 1; public ClipAnimationHelper(Context context) { mWindowCornerRadius = getWindowCornerRadius(context.getResources()); @@ -119,8 +119,12 @@ public class ClipAnimationHelper { } public void updateSource(Rect homeStackBounds, RemoteAnimationTargetCompat target) { - mHomeStackBounds.set(homeStackBounds); updateSourceStack(target); + updateHomeBounds(homeStackBounds); + } + + public void updateHomeBounds(Rect homeStackBounds) { + mHomeStackBounds.set(homeStackBounds); } public void updateTargetRect(Rect targetRect) { @@ -187,12 +191,12 @@ public class ClipAnimationHelper { Rect crop = mTmpRect; crop.set(app.sourceContainerBounds); crop.offsetTo(0, 0); - float alpha = 1f; + float alpha; int layer = RemoteAnimationProvider.getLayer(app, mBoostModeTargetLayers); float cornerRadius = 0f; float scale = Math.max(params.currentRect.width(), mTargetRect.width()) / crop.width(); if (app.mode == targetSet.targetMode) { - alpha = mTaskAlphaCallback.apply(app, params.targetAlpha); + alpha = mTaskAlphaCallback.getAlpha(app, params.targetAlpha); if (app.activityType != RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME) { mTmpMatrix.setRectToRect(mSourceRect, params.currentRect, ScaleToFit.FILL); mTmpMatrix.postTranslate(app.position.x, app.position.y); @@ -214,9 +218,12 @@ public class ClipAnimationHelper { // home target. alpha = 1 - (progress * params.targetAlpha); } - } else if (ENABLE_QUICKSTEP_LIVE_TILE.get() && launcherOnTop) { - crop = null; - layer = Integer.MAX_VALUE; + } else { + alpha = mBaseAlphaCallback.getAlpha(app, progress); + if (ENABLE_QUICKSTEP_LIVE_TILE.get() && launcherOnTop) { + crop = null; + layer = Integer.MAX_VALUE; + } } // Since radius is in Surface space, but we draw the rounded corners in screen space, we @@ -247,11 +254,14 @@ public class ClipAnimationHelper { } } - public void setTaskAlphaCallback( - BiFunction<RemoteAnimationTargetCompat, Float, Float> callback) { + public void setTaskAlphaCallback(TargetAlphaProvider callback) { mTaskAlphaCallback = callback; } + public void setBaseAlphaCallback(TargetAlphaProvider callback) { + mBaseAlphaCallback = callback; + } + public void fromTaskThumbnailView(TaskThumbnailView ttv, RecentsView rv) { fromTaskThumbnailView(ttv, rv, null); } @@ -357,6 +367,10 @@ public class ClipAnimationHelper { return mCurrentCornerRadius; } + public interface TargetAlphaProvider { + float getAlpha(RemoteAnimationTargetCompat target, float expectedAlpha); + } + public static class TransformParams { float progress; public float offsetX; |