summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewWidget.java
diff options
context:
space:
mode:
authorPatrick Dubroy <dubroy@google.com>2011-02-18 14:35:21 -0800
committerPatrick Dubroy <dubroy@google.com>2011-02-18 20:03:59 -0800
commit5f445425606b2c27276a79e9e871cf7f67b1b719 (patch)
tree51e130898b544bdc098fb67f32a6dfcdbb1c9150 /src/com/android/launcher2/PagedViewWidget.java
parenta88b213087ea46060bbbebbae52e069b873f3097 (diff)
downloadandroid_packages_apps_Trebuchet-5f445425606b2c27276a79e9e871cf7f67b1b719.tar.gz
android_packages_apps_Trebuchet-5f445425606b2c27276a79e9e871cf7f67b1b719.tar.bz2
android_packages_apps_Trebuchet-5f445425606b2c27276a79e9e871cf7f67b1b719.zip
Add missing animations when dragging from customize.
- Fix 3453751: Moon landing on canceled drag from customize - Fix 3453595: Use home screen "consume" animation when dragging and dropping Change-Id: Ia6a83c2d7a8f24c3ce02811547a35a7022d245f6
Diffstat (limited to 'src/com/android/launcher2/PagedViewWidget.java')
-rw-r--r--src/com/android/launcher2/PagedViewWidget.java18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
index 9b83f4823..07b215d44 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -257,8 +257,7 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
sWorker.removeMessages(MESSAGE_CREATE_HOLOGRAPHIC_OUTLINE, this);
}
- @Override
- public void setChecked(boolean checked) {
+ void setChecked(boolean checked, boolean animate) {
if (mIsChecked != checked) {
mIsChecked = checked;
@@ -276,15 +275,24 @@ public class PagedViewWidget extends LinearLayout implements Checkable {
if (mCheckedAlphaAnimator != null) {
mCheckedAlphaAnimator.cancel();
}
- mCheckedAlphaAnimator = ObjectAnimator.ofFloat(this, "alpha", getAlpha(), alpha);
- mCheckedAlphaAnimator.setDuration(duration);
- mCheckedAlphaAnimator.start();
+ if (animate) {
+ mCheckedAlphaAnimator = ObjectAnimator.ofFloat(this, "alpha", getAlpha(), alpha);
+ mCheckedAlphaAnimator.setDuration(duration);
+ mCheckedAlphaAnimator.start();
+ } else {
+ setAlpha(alpha);
+ }
invalidate();
}
}
@Override
+ public void setChecked(boolean checked) {
+ setChecked(checked, true);
+ }
+
+ @Override
public boolean isChecked() {
return mIsChecked;
}