diff options
author | Mike LeBeau <mlebeau@android.com> | 2009-07-29 18:17:13 -0700 |
---|---|---|
committer | Mike LeBeau <mlebeau@android.com> | 2009-07-29 18:17:13 -0700 |
commit | 5a7d752b65edc83abc1eeef462b8bf01038ebdff (patch) | |
tree | deabaec6e1ba6d8b3927e4a2c185e3cc4716189a /core | |
parent | 0067057c31720f64926d6ee3d841b15dc197d2df (diff) | |
download | frameworks_base-5a7d752b65edc83abc1eeef462b8bf01038ebdff.zip frameworks_base-5a7d752b65edc83abc1eeef462b8bf01038ebdff.tar.gz frameworks_base-5a7d752b65edc83abc1eeef462b8bf01038ebdff.tar.bz2 |
Special-case search within the browser to not show the app icon
to the left of the search field. Also, because this removes context
about whether you're in browser search or global search, we make
sure to clear any entered text if you jump out to global search from
within browser search.
This is a really ugly hack, but was required by the UI team. We will
find a better way to reconcile in Eclair.
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/SearchDialog.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java index fcfbd17..4dd2433 100644 --- a/core/java/android/app/SearchDialog.java +++ b/core/java/android/app/SearchDialog.java @@ -270,6 +270,16 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS if (!mGlobalSearchMode) { mStoredComponentName = mLaunchComponent; mStoredAppSearchData = mAppSearchData; + + // If this is the browser, we have a special case to not show the icon to the left + // of the text field, for extra space for url entry (this should be reconciled in + // Eclair). So special case a second tap of the search button to remove any + // already-entered text so that we can be sure to show the "Quick Search Box" hint + // text to still make it clear to the user that we've jumped out to global search. + // + // TODO: When the browser icon issue is reconciled in Eclair, remove this special case. + if (isBrowserSearch()) currentSearchText = ""; + return doShow(currentSearchText, false, null, mAppSearchData, true); } else { if (mStoredComponentName != null) { @@ -577,7 +587,11 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } private void updateSearchAppIcon() { - if (mGlobalSearchMode) { + // In Donut, we special-case the case of the browser to hide the app icon as if it were + // global search, for extra space for url entry. + // + // TODO: Remove this special case once the issue has been reconciled in Eclair. + if (mGlobalSearchMode || isBrowserSearch()) { mAppIcon.setImageResource(0); mAppIcon.setVisibility(View.GONE); mSearchPlate.setPadding(SEARCH_PLATE_LEFT_PADDING_GLOBAL, @@ -668,6 +682,16 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS } mVoiceButton.setVisibility(visibility); } + + /** + * Hack to determine whether this is the browser, so we can remove the browser icon + * to the left of the search field, as a special requirement for Donut. + * + * TODO: For Eclair, reconcile this with the rest of the global search UI. + */ + private boolean isBrowserSearch() { + return mLaunchComponent.flattenToShortString().startsWith("com.android.browser/"); + } /* * Menu. |