diff options
author | Adam Cohen <adamcohen@google.com> | 2015-05-22 19:23:34 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2015-07-07 18:52:09 -0700 |
commit | 947e02b638c7947c6c97943041d7153edb7b562e (patch) | |
tree | 014e267dae077edcbc3407a80d5d2906c20819be /src/com | |
parent | cc31d463279016d0ce1f15886a8cf2aee7d4c54b (diff) | |
download | android_packages_apps_Trebuchet-947e02b638c7947c6c97943041d7153edb7b562e.tar.gz android_packages_apps_Trebuchet-947e02b638c7947c6c97943041d7153edb7b562e.tar.bz2 android_packages_apps_Trebuchet-947e02b638c7947c6c97943041d7153edb7b562e.zip |
Adding custom slide up activity transition for L MR1
issue 21402755
Change-Id: Id2542c0a3c38bd71aa407a3b0fe00fdee24e2f69
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 7 | ||||
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 0a20fa48d..4e83a67f3 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2899,8 +2899,15 @@ public class Launcher extends Activity } } if (opts == null && !Utilities.isLmpOrAbove()) { + // Below L, we use a scale up animation opts = ActivityOptions.makeScaleUpAnimation(v, 0, 0, v.getMeasuredWidth(), v.getMeasuredHeight()); + } else if (opts == null && Utilities.isLmpMR1()) { + // On L devices, we use the device default slide-up transition. + // On L MR1 devices, we a custom version of the slide-up transition which + // doesn't have the delay present in the device default. + opts = ActivityOptions.makeCustomAnimation(this, + R.anim.task_open_enter, R.anim.no_anim); } optsBundle = opts != null ? opts.toBundle() : null; } diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 19334ed31..d0c24cd83 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -123,6 +123,11 @@ public final class Utilities { return Build.VERSION.SDK_INT >= 22; } + public static boolean isLmpMR1() { + // TODO(adamcohen): update to Build.VERSION_CODES.LOLLIPOP_MR1 once building against 22; + return Build.VERSION.SDK_INT == 22; + } + public static Bitmap createIconBitmap(Cursor c, int iconIndex, Context context) { byte[] data = c.getBlob(iconIndex); try { |