Animate launcher when launching recent tasks
- Scale up adjacent recent tasks and translate away from center
- Workspace card instead recenters in the screen
- Translate hotseat offscreen
Clicking on one of the adjacent tasks will scale it up to the
center of the screen while the center and other adjacent task
parallax to the right beneath it.
Change-Id: If96eec987c100458b8444a6cd698ec7bf6e6ba6b
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index b87511a..ed8d39c 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -39,6 +39,7 @@
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
+import android.app.ActivityOptions;
import android.app.AlertDialog;
import android.appwidget.AppWidgetHostView;
import android.appwidget.AppWidgetManager;
@@ -1924,7 +1925,7 @@
intent.setSourceBounds(getViewBounds(v));
// If there is no target package, use the default intent chooser animation
launchOptions = hasTargetPackage
- ? getActivityLaunchOptions(v, isInMultiWindowModeCompat())
+ ? getActivityLaunchOptionsAsBundle(v, isInMultiWindowModeCompat())
: null;
} else {
launchOptions = null;
@@ -1979,8 +1980,13 @@
}
}
+ public Bundle getActivityLaunchOptionsAsBundle(View v, boolean useDefaultLaunchOptions) {
+ ActivityOptions activityOptions = getActivityLaunchOptions(v, useDefaultLaunchOptions);
+ return activityOptions == null ? null : activityOptions.toBundle();
+ }
+
@TargetApi(Build.VERSION_CODES.M)
- public Bundle getActivityLaunchOptions(View v, boolean useDefaultLaunchOptions) {
+ public ActivityOptions getActivityLaunchOptions(View v, boolean useDefaultLaunchOptions) {
return useDefaultLaunchOptions
? mAppTransitionManager.getDefaultActivityLaunchOptions(this, v)
: mAppTransitionManager.getActivityLaunchOptions(this, v);
@@ -2004,7 +2010,7 @@
boolean useLaunchAnimation = (v != null) &&
!intent.hasExtra(INTENT_EXTRA_IGNORE_LAUNCH_ANIMATION);
Bundle optsBundle = useLaunchAnimation
- ? getActivityLaunchOptions(v, isInMultiWindowModeCompat())
+ ? getActivityLaunchOptionsAsBundle(v, isInMultiWindowModeCompat())
: null;
UserHandle user = item == null ? null : item.user;