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
diff --git a/src/com/android/launcher2/PagedViewIcon.java b/src/com/android/launcher2/PagedViewIcon.java
index 1366619..9c5d126 100644
--- a/src/com/android/launcher2/PagedViewIcon.java
+++ b/src/com/android/launcher2/PagedViewIcon.java
@@ -243,8 +243,7 @@
return mIsChecked;
}
- @Override
- public void setChecked(boolean checked) {
+ void setChecked(boolean checked, boolean animate) {
if (mIsChecked != checked) {
mIsChecked = checked;
@@ -262,15 +261,24 @@
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 void toggle() {
setChecked(!mIsChecked);
}