From 99840f48519809b6b390d53d0378fa4eece0496c Mon Sep 17 00:00:00 2001 From: Danesh Mondegarian Date: Thu, 13 Feb 2014 21:58:48 -0800 Subject: Trebuchet : Fix search bar icon/text disapearing Repro : 1. Uninstall an application from the app drawer 2. Press back to go to homescreen. 3. The search bar icon/text should be invisible now. Trebuchet : Avoid unecessary generatePressedFocusedStates When the drawable's state changes, don't generate state drawables until after the invalidate call, which takes care of this already, otherwise it gets drawn before measure/layout gets a chance to run. Change-Id: I49933e6d985aab9fff9f05092e007e46991a8edf --- src/com/android/launcher3/FastBitmapDrawable.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/com/android/launcher3/FastBitmapDrawable.java') diff --git a/src/com/android/launcher3/FastBitmapDrawable.java b/src/com/android/launcher3/FastBitmapDrawable.java index ff02bbbc3..d13f66a7c 100644 --- a/src/com/android/launcher3/FastBitmapDrawable.java +++ b/src/com/android/launcher3/FastBitmapDrawable.java @@ -113,12 +113,20 @@ class FastBitmapDrawable extends Drawable { @Override public int getIntrinsicWidth() { - return mBitmap.getWidth(); + int width = getBounds().width(); + if (width == 0) { + width = mBitmap.getWidth(); + } + return width; } @Override public int getIntrinsicHeight() { - return mBitmap.getHeight(); + int height = getBounds().height(); + if (height == 0) { + height = mBitmap.getHeight(); + } + return height; } @Override -- cgit v1.2.3