summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanesh Mondegarian <daneshm90@gmail.com>2014-02-14 05:58:48 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2014-12-23 21:43:52 (GMT)
commit99840f48519809b6b390d53d0378fa4eece0496c (patch)
tree3faf693c8e25bc242a2bb124944d49f6f0a02f8c
parentaed08787684b6351082c3a1bfbec2c54d365ee2b (diff)
downloadandroid_packages_apps_Trebuchet-99840f48519809b6b390d53d0378fa4eece0496c.zip
android_packages_apps_Trebuchet-99840f48519809b6b390d53d0378fa4eece0496c.tar.gz
android_packages_apps_Trebuchet-99840f48519809b6b390d53d0378fa4eece0496c.tar.bz2
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
-rw-r--r--src/com/android/launcher3/FastBitmapDrawable.java12
-rw-r--r--src/com/android/launcher3/HolographicImageView.java1
-rw-r--r--src/com/android/launcher3/HolographicLinearLayout.java1
-rw-r--r--src/com/android/launcher3/Launcher.java2
4 files changed, 11 insertions, 5 deletions
diff --git a/src/com/android/launcher3/FastBitmapDrawable.java b/src/com/android/launcher3/FastBitmapDrawable.java
index ff02bbb..d13f66a 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
diff --git a/src/com/android/launcher3/HolographicImageView.java b/src/com/android/launcher3/HolographicImageView.java
index 18ac092..33ab8b5 100644
--- a/src/com/android/launcher3/HolographicImageView.java
+++ b/src/com/android/launcher3/HolographicImageView.java
@@ -80,7 +80,6 @@ public class HolographicImageView extends ImageView {
protected void drawableStateChanged() {
super.drawableStateChanged();
- mHolographicHelper.generatePressedFocusedStates(this);
Drawable d = getDrawable();
if (d instanceof StateListDrawable) {
StateListDrawable sld = (StateListDrawable) d;
diff --git a/src/com/android/launcher3/HolographicLinearLayout.java b/src/com/android/launcher3/HolographicLinearLayout.java
index 5344a7e..96acb03 100644
--- a/src/com/android/launcher3/HolographicLinearLayout.java
+++ b/src/com/android/launcher3/HolographicLinearLayout.java
@@ -84,7 +84,6 @@ public class HolographicLinearLayout extends LinearLayout {
super.drawableStateChanged();
if (mImageView != null) {
- mHolographicHelper.generatePressedFocusedStates(mImageView);
Drawable d = mImageView.getDrawable();
if (d instanceof StateListDrawable) {
StateListDrawable sld = (StateListDrawable) d;
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index 3ce4a57..041d21b 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -4338,7 +4338,7 @@ public class Launcher extends Activity
final SearchManager searchManager =
(SearchManager) getSystemService(Context.SEARCH_SERVICE);
ComponentName activityName = searchManager.getGlobalSearchActivity();
- if (activityName != null && mWorkspace.shouldVoiceButtonProxyBeVisible()) {
+ if (activityName != null) {
int coi = getCurrentOrientationIndexForGlobalIcons();
sGlobalSearchIcon[coi] = updateButtonWithIconFromExternalActivity(
R.id.search_button, activityName, R.drawable.ic_home_search_normal_holo,