diff options
| author | 2009-09-17 21:31:16 +0100 | |
|---|---|---|
| committer | 2009-09-18 11:30:36 +0100 | |
| commit | dfcbc046d7fcd74c8aacd9f26bd48084900d3b4a (patch) | |
| tree | ef3967c7ca8f2d84026d367ef3606c3115cca3ec | |
| parent | 0050ee36398c3ab6e5f1ee0038609aff8cf4f0e9 (diff) | |
Reserve space for the searchbox spinner, even when stopped.
Make the searchbox spinner invisible (transparent) when it's not active. This prevents the size of the text field from varying depending on whether the spinner is spinning or not, which can cause an annoying flicker.
Bug: 2084293
Change-Id: Idd63a296d1f07c5bd47884040f21e4880038f424
| -rw-r--r-- | core/java/android/app/SearchDialog.java | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index 1209d0fdc815..d05c9ab558c5 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -191,7 +191,10 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS mSearchPlate = findViewById(com.android.internal.R.id.search_plate); mWorkingSpinner = getContext().getResources(). getDrawable(com.android.internal.R.drawable.search_spinner); - + mSearchAutoComplete.setCompoundDrawablesWithIntrinsicBounds( + null, null, mWorkingSpinner, null); + setWorking(false); + // attach listeners mSearchAutoComplete.addTextChangedListener(mTextWatcher); mSearchAutoComplete.setOnKeyListener(mTextKeyListener); @@ -407,15 +410,9 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS * @param working true to show spinner, false to hide spinner */ public void setWorking(boolean working) { - if (working) { - mSearchAutoComplete.setCompoundDrawablesWithIntrinsicBounds( - null, null, mWorkingSpinner, null); - ((Animatable) mWorkingSpinner).start(); - } else { - mSearchAutoComplete.setCompoundDrawablesWithIntrinsicBounds( - null, null, null, null); - ((Animatable) mWorkingSpinner).stop(); - } + mWorkingSpinner.setAlpha(working ? 255 : 0); + mWorkingSpinner.setVisible(working, false); + mWorkingSpinner.invalidateSelf(); } /** |