diff options
author | Tony Wickham <twickham@google.com> | 2018-02-26 22:42:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-02-26 22:42:08 +0000 |
commit | 5a22795484bb39fd63e694eaf993e471e18f6814 (patch) | |
tree | 6cdf96503c31ed2d7fca4b9015e249ae0cb379cc /src | |
parent | ee5de5d13d4f6dd92d2097c09bb57949a428e347 (diff) | |
parent | 005df0ba69e38aa94a9f55eb43819a426c0cd3cc (diff) | |
download | android_packages_apps_Trebuchet-5a22795484bb39fd63e694eaf993e471e18f6814.tar.gz android_packages_apps_Trebuchet-5a22795484bb39fd63e694eaf993e471e18f6814.tar.bz2 android_packages_apps_Trebuchet-5a22795484bb39fd63e694eaf993e471e18f6814.zip |
Merge "Animate launcher when launching recent tasks" into ub-launcher3-master
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 12 | ||||
-rw-r--r-- | src/com/android/launcher3/LauncherAppTransitionManager.java | 15 | ||||
-rw-r--r-- | src/com/android/launcher3/popup/SystemShortcut.java | 2 |
3 files changed, 19 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 1d474da19..55bfef6cb 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -39,6 +39,7 @@ import android.animation.ObjectAnimator; 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 @@ public class Launcher extends BaseActivity 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 class Launcher extends BaseActivity } } + 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 @@ public class Launcher extends BaseActivity 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; diff --git a/src/com/android/launcher3/LauncherAppTransitionManager.java b/src/com/android/launcher3/LauncherAppTransitionManager.java index 43d5e623d..19fa3d445 100644 --- a/src/com/android/launcher3/LauncherAppTransitionManager.java +++ b/src/com/android/launcher3/LauncherAppTransitionManager.java @@ -21,7 +21,6 @@ import android.app.ActivityOptions; import android.content.Context; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.os.Bundle; import android.view.View; /** @@ -34,7 +33,7 @@ public class LauncherAppTransitionManager { context, R.string.app_transition_manager_class); } - public Bundle getDefaultActivityLaunchOptions(Launcher launcher, View v) { + public ActivityOptions getDefaultActivityLaunchOptions(Launcher launcher, View v) { if (Utilities.ATLEAST_MARSHMALLOW) { int left = 0, top = 0; int width = v.getMeasuredWidth(), height = v.getMeasuredHeight(); @@ -49,23 +48,27 @@ public class LauncherAppTransitionManager { height = bounds.height(); } } - return ActivityOptions.makeClipRevealAnimation(v, left, top, width, height) - .toBundle(); + return ActivityOptions.makeClipRevealAnimation(v, left, top, width, height); } else if (Utilities.ATLEAST_LOLLIPOP_MR1) { // On L devices, we use the device default slide-up transition. // On L MR1 devices, we use a custom version of the slide-up transition which // doesn't have the delay present in the device default. return ActivityOptions.makeCustomAnimation(launcher, R.anim.task_open_enter, - R.anim.no_anim).toBundle(); + R.anim.no_anim); } return null; } - public Bundle getActivityLaunchOptions(Launcher launcher, View v) { + public ActivityOptions getActivityLaunchOptions(Launcher launcher, View v) { return getDefaultActivityLaunchOptions(launcher, v); } /** Cancels the current Launcher transition animation */ public void finishLauncherAnimation() { } + + public boolean isAnimating() { + // We don't know when the activity options are being used. + return false; + } } diff --git a/src/com/android/launcher3/popup/SystemShortcut.java b/src/com/android/launcher3/popup/SystemShortcut.java index d2bcd1852..32fd0633c 100644 --- a/src/com/android/launcher3/popup/SystemShortcut.java +++ b/src/com/android/launcher3/popup/SystemShortcut.java @@ -82,7 +82,7 @@ public abstract class SystemShortcut extends ItemInfo { @Override public void onClick(View view) { Rect sourceBounds = launcher.getViewBounds(view); - Bundle opts = launcher.getActivityLaunchOptions(view, false); + Bundle opts = launcher.getActivityLaunchOptionsAsBundle(view, false); InfoDropTarget.startDetailsActivityForInfo(itemInfo, launcher, sourceBounds, opts); launcher.getUserEventDispatcher().logActionOnControl(Action.Touch.TAP, ControlType.APPINFO_TARGET, view); |