summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorcretin45 <cretin45@gmail.com>2016-02-03 16:30:15 -0800
committerTom Powell <zifnab@zifnab06.net>2017-03-26 16:14:45 -0700
commit44432c59564135ee767283ef961ca84a371981f4 (patch)
tree1922b7502401122711a00132c93db6ff9c006a1f /src/com/android
parente2678cea5161d8d9616074d7bf4c28ae6f404793 (diff)
downloadandroid_packages_apps_Trebuchet-44432c59564135ee767283ef961ca84a371981f4.tar.gz
android_packages_apps_Trebuchet-44432c59564135ee767283ef961ca84a371981f4.tar.bz2
android_packages_apps_Trebuchet-44432c59564135ee767283ef961ca84a371981f4.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')
-rw-r--r--src/com/android/launcher3/Folder.java12
-rw-r--r--src/com/android/launcher3/Launcher.java8
2 files changed, 16 insertions, 4 deletions
diff --git a/src/com/android/launcher3/Folder.java b/src/com/android/launcher3/Folder.java
index e8e8f2d16..8c697ee78 100644
--- a/src/com/android/launcher3/Folder.java
+++ b/src/com/android/launcher3/Folder.java
@@ -806,10 +806,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 90eec62c2..5d3cd2774 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -2495,7 +2495,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()) {
@@ -3520,12 +3520,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);
}
}