diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-26 10:33:55 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-05-26 10:33:55 -0700 |
commit | d185cac23ccda47d73110d0bdf3c23434ee76340 (patch) | |
tree | 71bf9c8617353968ea31ba5d29c0c55071792189 /core | |
parent | de8268d6d1cd168510c490b17e93154d2eab767c (diff) | |
parent | a97f4a117415fd877bc63d6c90a6775ca04eb3fe (diff) | |
download | frameworks_base-d185cac23ccda47d73110d0bdf3c23434ee76340.zip frameworks_base-d185cac23ccda47d73110d0bdf3c23434ee76340.tar.gz frameworks_base-d185cac23ccda47d73110d0bdf3c23434ee76340.tar.bz2 |
Merge change 2393 into donut
* changes:
Remove dimmed background (and accompanying animation) for global search, since we should never really see that background anyway, and I suspect the animation is using a significant amount of CPU.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/SearchDialog.java | 18 | ||||
-rw-r--r-- | core/res/res/values/themes.xml | 6 |
2 files changed, 23 insertions, 1 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index aaaf7bf..ff110c8 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -49,6 +49,7 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.util.AttributeSet; import android.util.Log; +import android.view.ContextThemeWrapper; import android.view.Gravity; import android.view.KeyEvent; import android.view.MotionEvent; @@ -165,7 +166,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS * @param context Application Context we can use for system acess */ public SearchDialog(Context context) { - super(context, com.android.internal.R.style.Theme_SearchBar); + super(context, com.android.internal.R.style.Theme_GlobalSearchBar); } /** @@ -393,6 +394,21 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS getContext().getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.showSoftInputUnchecked(0, null); } + + // The Dialog uses a ContextThemeWrapper for the context; use this to change the + // theme out from underneath us, between the global search theme and the in-app + // search theme. They are identical except that the global search theme does not + // dim the background of the window (because global search is full screen so it's + // not needed and this should save a little bit of time on global search invocation). + Object context = getContext(); + if (context instanceof ContextThemeWrapper) { + ContextThemeWrapper wrapper = (ContextThemeWrapper) context; + if (globalSearch) { + wrapper.setTheme(com.android.internal.R.style.Theme_GlobalSearchBar); + } else { + wrapper.setTheme(com.android.internal.R.style.Theme_SearchBar); + } + } show(); } diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index 00dc6fa..1c87220 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -368,6 +368,12 @@ <item name="android:backgroundDimEnabled">true</item> <item name="windowContentOverlay">@null</item> </style> + + <!-- Theme for the search input bar when doing global search. The only + difference from non-global search is that we do not dim the background. --> + <style name="Theme.GlobalSearchBar" parent="Theme.Panel"> + <item name="windowContentOverlay">@null</item> + </style> <!-- Menu Themes --> <eat-comment /> |