diff options
author | Winson Chung <winsonc@google.com> | 2011-10-05 11:44:49 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2011-10-05 14:30:32 -0700 |
commit | c51db6accf2fdcb15d6361a38b176534e3d2cca5 (patch) | |
tree | e0ef9884937723870916b3a0d09b745a52fd34ed /src/com/android/launcher2/SearchDropTargetBar.java | |
parent | 9b09219df6601a877425c6dfad4a8de8a1ea2f44 (diff) | |
download | android_packages_apps_Trebuchet-c51db6accf2fdcb15d6361a38b176534e3d2cca5.tar.gz android_packages_apps_Trebuchet-c51db6accf2fdcb15d6361a38b176534e3d2cca5.tar.bz2 android_packages_apps_Trebuchet-c51db6accf2fdcb15d6361a38b176534e3d2cca5.zip |
Fixing some search box issues.
- Voice search still clickable and causes crash (Bug: 5371480)
- Empty search box when QSB is disabled (Bug: 5358074)
Change-Id: I97cef678b012c8294fca9149e22458abed31075d
Diffstat (limited to 'src/com/android/launcher2/SearchDropTargetBar.java')
-rw-r--r-- | src/com/android/launcher2/SearchDropTargetBar.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/launcher2/SearchDropTargetBar.java b/src/com/android/launcher2/SearchDropTargetBar.java index 69a121341..b4a9fc9c0 100644 --- a/src/com/android/launcher2/SearchDropTargetBar.java +++ b/src/com/android/launcher2/SearchDropTargetBar.java @@ -21,7 +21,7 @@ import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.content.Context; -import android.content.res.Configuration; +import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.View; import android.view.animation.AccelerateInterpolator; @@ -52,6 +52,8 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D private int mBarHeight; private boolean mDeferOnDragEnd = false; + private Drawable mPreviousBackground; + public SearchDropTargetBar(Context context, AttributeSet attrs) { this(context, attrs, 0); } @@ -213,4 +215,18 @@ public class SearchDropTargetBar extends FrameLayout implements DragController.D mDeferOnDragEnd = false; } } + + public void onSearchPackagesChanged(boolean searchVisible, boolean voiceVisible) { + if (mQSBSearchBar != null) { + Drawable bg = mQSBSearchBar.getBackground(); + if (bg != null && (!searchVisible && !voiceVisible)) { + // Save the background and disable it + mPreviousBackground = bg; + mQSBSearchBar.setBackgroundResource(0); + } else if (mPreviousBackground != null && (searchVisible || voiceVisible)) { + // Restore the background + mQSBSearchBar.setBackgroundDrawable(mPreviousBackground); + } + } + } } |