diff options
author | cretin45 <cretin45@gmail.com> | 2016-02-03 16:30:15 -0800 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2016-02-03 16:31:25 -0800 |
commit | 5f345281eb4f2752b99637203e63679d6bee504c (patch) | |
tree | 322f0141d72966c02c5c13511e9ec7a514f0581f /src/com/android/launcher3 | |
parent | 15d36326dffc038551fcdc1632176402700e33a8 (diff) | |
download | android_packages_apps_Trebuchet-5f345281eb4f2752b99637203e63679d6bee504c.tar.gz android_packages_apps_Trebuchet-5f345281eb4f2752b99637203e63679d6bee504c.tar.bz2 android_packages_apps_Trebuchet-5f345281eb4f2752b99637203e63679d6bee504c.zip |
Trebuchet: Don't animate folder closed when pressing menu key
* Also don't animate with Y translation if animation boolean is false.
Issue-id: OPO-434
Change-Id: I4d2e68d967eca87c3e3d27e4ea22d4126ef3c998
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r-- | src/com/android/launcher3/Folder.java | 12 | ||||
-rw-r--r-- | src/com/android/launcher3/Launcher.java | 8 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java index 4763172c9..2e73c5749 100644 --- a/src/com/android/launcher3/Folder.java +++ b/src/com/android/launcher3/Folder.java @@ -791,10 +791,18 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList if (mPowerManager.isPowerSaveMode() || animatorDurationScale < 0.01f) { // power save mode is no fun - skip alpha animation and just set it to 0 // otherwise the icons will stay around until the duration of the animation - oa = LauncherAnimUtils.ofPropertyValuesHolder(this, translationY); + if (animate) { + oa = LauncherAnimUtils.ofPropertyValuesHolder(this, translationY); + } else { + oa = LauncherAnimUtils.ofPropertyValuesHolder(this); + } setAlpha(0f); } else { - oa = LauncherAnimUtils.ofPropertyValuesHolder(this, alpha, translationY); + if (animate) { + oa = LauncherAnimUtils.ofPropertyValuesHolder(this, alpha, translationY); + } else { + oa = LauncherAnimUtils.ofPropertyValuesHolder(this, alpha); + } } oa.setDuration(mMaterialExpandDuration); diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 39a7041e0..bc7cb6290 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -2528,7 +2528,7 @@ public class Launcher extends Activity super.onPrepareOptionsMenu(menu); if (!isOnCustomContent()) { // Close any open folders - closeFolder(); + closeFolder(false); // Stop resizing any widgets mWorkspace.exitWidgetResizeMode(); if (!mWorkspace.isInOverviewMode()) { @@ -3567,12 +3567,16 @@ public class Launcher extends Activity } public void closeFolder() { + closeFolder(true); + } + + public void closeFolder(boolean animate) { Folder folder = mWorkspace != null ? mWorkspace.getOpenFolder() : null; if (folder != null) { if (folder.isEditingName()) { folder.dismissEditingName(); } - closeFolder(folder); + closeFolder(folder, animate); } } |