summaryrefslogtreecommitdiffstats
path: root/go
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-05-10 21:08:28 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-10 21:08:28 +0000
commit695e8df52647465f4c9d93c89e2d57c613db53d6 (patch)
tree759f3f7ddb4cdaac8a094347b85c4a743e595881 /go
parent76696be287e61a74f1179825d27292494d746555 (diff)
parentd0863ae5c4dbcabc3522c335bc41f7fdb21bf113 (diff)
downloadandroid_packages_apps_Trebuchet-695e8df52647465f4c9d93c89e2d57c613db53d6.tar.gz
android_packages_apps_Trebuchet-695e8df52647465f4c9d93c89e2d57c613db53d6.tar.bz2
android_packages_apps_Trebuchet-695e8df52647465f4c9d93c89e2d57c613db53d6.zip
Merge "Add basic home to recents anim for fallback recents" into ub-launcher3-qt-dev
Diffstat (limited to 'go')
-rw-r--r--go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java7
-rw-r--r--go/quickstep/src/com/android/quickstep/views/IconRecentsView.java47
2 files changed, 53 insertions, 1 deletions
diff --git a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java
index c03222db1..fe10a7a21 100644
--- a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java
+++ b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java
@@ -17,6 +17,7 @@ package com.android.quickstep;
import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
import static com.android.quickstep.views.IconRecentsView.REMOTE_APP_TO_OVERVIEW_DURATION;
+import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACTIVITY_TYPE_HOME;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_CLOSING;
import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.MODE_OPENING;
@@ -134,7 +135,11 @@ final class AppToOverviewAnimationProvider<T extends BaseDraggingActivity> imple
return anim;
}
- mRecentsView.playRemoteAppToRecentsAnimation(anim, closingAppTarget, recentsTarget);
+ if (closingAppTarget.activityType == ACTIVITY_TYPE_HOME) {
+ mRecentsView.playRemoteHomeToRecentsAnimation(anim, closingAppTarget, recentsTarget);
+ } else {
+ mRecentsView.playRemoteAppToRecentsAnimation(anim, closingAppTarget, recentsTarget);
+ }
return anim;
}
diff --git a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
index 2572bdd11..ab7ab6f8d 100644
--- a/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
+++ b/go/quickstep/src/com/android/quickstep/views/IconRecentsView.java
@@ -642,6 +642,53 @@ public final class IconRecentsView extends FrameLayout implements Insettable {
}
/**
+ * Play remote app to recents animation when the app is the home activity. We use a simple
+ * cross-fade here. Note this is only used if the home activity is a separate app than the
+ * recents activity.
+ *
+ * @param anim animator set
+ * @param homeTarget the home surface thats closing
+ * @param recentsTarget the surface containing recents
+ */
+ public void playRemoteHomeToRecentsAnimation(@NonNull AnimatorSet anim,
+ @NonNull RemoteAnimationTargetCompat homeTarget,
+ @NonNull RemoteAnimationTargetCompat recentsTarget) {
+ SyncRtSurfaceTransactionApplierCompat surfaceApplier =
+ new SyncRtSurfaceTransactionApplierCompat(this);
+
+ SurfaceParams[] params = new SurfaceParams[2];
+ int boostedMode = MODE_CLOSING;
+
+ ValueAnimator remoteHomeAnim = ValueAnimator.ofFloat(0, 1);
+ remoteHomeAnim.setDuration(REMOTE_APP_TO_OVERVIEW_DURATION);
+
+ remoteHomeAnim.addUpdateListener(valueAnimator -> {
+ float val = (float) valueAnimator.getAnimatedValue();
+ float alpha;
+ RemoteAnimationTargetCompat visibleTarget;
+ RemoteAnimationTargetCompat invisibleTarget;
+ if (val < .5f) {
+ visibleTarget = homeTarget;
+ invisibleTarget = recentsTarget;
+ alpha = 1 - (val * 2);
+ } else {
+ visibleTarget = recentsTarget;
+ invisibleTarget = homeTarget;
+ alpha = (val - .5f) * 2;
+ }
+ params[0] = new SurfaceParams(visibleTarget.leash, alpha, null /* matrix */,
+ null /* windowCrop */, getLayer(visibleTarget, boostedMode),
+ 0 /* cornerRadius */);
+ params[1] = new SurfaceParams(invisibleTarget.leash, 0.0f, null /* matrix */,
+ null /* windowCrop */, getLayer(invisibleTarget, boostedMode),
+ 0 /* cornerRadius */);
+ surfaceApplier.scheduleApply(params);
+ });
+ anim.play(remoteHomeAnim);
+ animateFadeInLayoutAnimation();
+ }
+
+ /**
* Play remote animation from app to recents. This should scale the currently closing app down
* to the recents thumbnail.
*