summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/BubbleTextView.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-05-15 17:00:24 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-05-15 17:05:38 -0700
commit69b756486cf113d002dae4a272533fb70fe8b88b (patch)
tree01fb6c80934ef191bbd56aa623bdf67aef23f2bc /src/com/android/launcher3/BubbleTextView.java
parent2d58471e8d3da621e209cec58a43d159778f8a0e (diff)
downloadandroid_packages_apps_Trebuchet-69b756486cf113d002dae4a272533fb70fe8b88b.tar.gz
android_packages_apps_Trebuchet-69b756486cf113d002dae4a272533fb70fe8b88b.tar.bz2
android_packages_apps_Trebuchet-69b756486cf113d002dae4a272533fb70fe8b88b.zip
Preventing relayout when loading high-res icons
Bug: 21133230 Change-Id: I1ec4dbfd28c42fa1c0e28b3fa746c0bc5dfaba7c
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r--src/com/android/launcher3/BubbleTextView.java11
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;
}
}