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
This commit is contained in:
Patrick Dubroy committed 2011-02-18 20:03:59 -08:00
1 parent a88b213087
commit 5f44542560
12 files changed
+208 -133

No files matched your search

+13 -5
View File
@@ -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,14 +275,23 @@ 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;