Merge "Preventing zoom-in animation from running everytime the app updates." into ub-launcher3-burnaby

This commit is contained in:
Sunny Goyal
2015-08-11 22:42:03 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 2 deletions
@@ -213,6 +213,10 @@ class PreloadIconDrawable extends Drawable {
return mAnimationProgress; return mAnimationProgress;
} }
public boolean hasNotCompleted() {
return mAnimationProgress < ANIMATION_PROGRESS_COMPLETED;
}
@Override @Override
public int getIntrinsicHeight() { public int getIntrinsicHeight() {
return mIcon.getIntrinsicHeight(); return mIcon.getIntrinsicHeight();
+3 -2
View File
@@ -4334,8 +4334,9 @@ public class Workspace extends PagedView
updates.contains(info)) { updates.contains(info)) {
ShortcutInfo si = (ShortcutInfo) info; ShortcutInfo si = (ShortcutInfo) info;
BubbleTextView shortcut = (BubbleTextView) v; BubbleTextView shortcut = (BubbleTextView) v;
boolean oldPromiseState = getTextViewIcon(shortcut) Drawable oldIcon = getTextViewIcon(shortcut);
instanceof PreloadIconDrawable; boolean oldPromiseState = (oldIcon instanceof PreloadIconDrawable)
&& ((PreloadIconDrawable) oldIcon).hasNotCompleted();
shortcut.applyFromShortcutInfo(si, mIconCache, shortcut.applyFromShortcutInfo(si, mIconCache,
si.isPromise() != oldPromiseState); si.isPromise() != oldPromiseState);