diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-05-18 18:15:21 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-18 18:15:22 +0000 |
commit | a926343d5c567b8cf32175530b1f6eb574e7eabc (patch) | |
tree | f72ccef32b29de295b902c6bba4252582032b00b | |
parent | 436eeb6b971fa27bf7df85494d4da0e878803665 (diff) | |
parent | 69b756486cf113d002dae4a272533fb70fe8b88b (diff) | |
download | android_packages_apps_Trebuchet-a926343d5c567b8cf32175530b1f6eb574e7eabc.tar.gz android_packages_apps_Trebuchet-a926343d5c567b8cf32175530b1f6eb574e7eabc.tar.bz2 android_packages_apps_Trebuchet-a926343d5c567b8cf32175530b1f6eb574e7eabc.zip |
Merge "Preventing relayout when loading high-res icons" into ub-launcher3-burnaby
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 5dc3b1239..d39e13976 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -28,6 +28,7 @@ import android.graphics.Region; import android.graphics.drawable.Drawable; import android.os.Build; import android.util.AttributeSet; +import android.util.Log; import android.util.SparseArray; import android.util.TypedValue; import android.view.KeyEvent; @@ -76,6 +77,7 @@ public class BubbleTextView extends TextView { private boolean mStayPressed; private boolean mIgnorePressedStateChange; + private boolean mDisableRelayout = false; private IconLoadRequest mIconLoadRequest; @@ -464,12 +466,20 @@ public class BubbleTextView extends TextView { return icon; } + @Override + public void requestLayout() { + if (!mDisableRelayout) { + super.requestLayout(); + } + } + /** * Applies the item info if it is same as what the view is pointing to currently. */ public void reapplyItemInfo(final ItemInfo info) { if (getTag() == info) { mIconLoadRequest = null; + mDisableRelayout = true; if (info instanceof AppInfo) { applyFromApplicationInfo((AppInfo) info); } else if (info instanceof ShortcutInfo) { @@ -478,6 +488,7 @@ public class BubbleTextView extends TextView { } else if (info instanceof PackageItemInfo) { applyFromPackageItemInfo((PackageItemInfo) info); } + mDisableRelayout = false; } } |