diff options
author | Anonymous Coward <nobody@android.com> | 2009-08-18 17:34:16 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2009-09-21 15:13:00 -0400 |
commit | 8c96ab5f343d656e08f1dc1022bffb75c81f8028 (patch) | |
tree | a9ec5c0d58f64a5ea9fcf0ebf56a000a87b60dfb /src | |
parent | 2dbeb0a91b89ca5dc03cff0df638123dcbb2d125 (diff) | |
download | android_packages_apps_Trebuchet-8c96ab5f343d656e08f1dc1022bffb75c81f8028.tar.gz android_packages_apps_Trebuchet-8c96ab5f343d656e08f1dc1022bffb75c81f8028.tar.bz2 android_packages_apps_Trebuchet-8c96ab5f343d656e08f1dc1022bffb75c81f8028.zip |
Remove the ability for the Google logo to hide itself based on the chosen
web search provider, as Google will be the only provider.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/Search.java | 48 |
1 files changed, 6 insertions, 42 deletions
diff --git a/src/com/android/launcher2/Search.java b/src/com/android/launcher2/Search.java index 203754ec8..214d585da 100644 --- a/src/com/android/launcher2/Search.java +++ b/src/com/android/launcher2/Search.java @@ -75,9 +75,7 @@ public class Search extends LinearLayout // For voice searching private Intent mVoiceSearchIntent; - - private Drawable mGooglePlaceholder; - + private SearchManager mSearchManager; /** @@ -299,10 +297,6 @@ public class Search extends LinearLayout mSearchText = (TextView) findViewById(R.id.search_src_text); mVoiceButton = (ImageButton) findViewById(R.id.search_voice_btn); - mGooglePlaceholder = getContext().getResources().getDrawable(R.drawable.placeholder_google); - mContext.registerReceiver(mBroadcastReceiver, - new IntentFilter(SearchManager.INTENT_ACTION_SEARCH_SETTINGS_CHANGED)); - mSearchText.setOnKeyListener(this); mSearchText.setOnClickListener(this); @@ -312,14 +306,17 @@ public class Search extends LinearLayout mSearchText.setOnLongClickListener(this); mVoiceButton.setOnLongClickListener(this); + // Set the placeholder text to be the Google logo within the search widget. + Drawable googlePlaceholder = + getContext().getResources().getDrawable(R.drawable.placeholder_google); + mSearchText.setCompoundDrawablesWithIntrinsicBounds(googlePlaceholder, null, null, null); + configureVoiceSearchButton(); - setUpTextField(); } @Override public void onDetachedFromWindow() { super.onDetachedFromWindow(); - if (mBroadcastReceiver != null) getContext().unregisterReceiver(mBroadcastReceiver); } /** @@ -341,45 +338,12 @@ public class Search extends LinearLayout } /** - * Sets up the look of the text field. If Google is the chosen search provider, includes - * a Google logo as placeholder. - */ - private void setUpTextField() { - boolean showGooglePlaceholder = false; - SearchableInfo webSearchSearchable = mSearchManager.getDefaultSearchableForWebSearch(); - if (webSearchSearchable != null) { - ComponentName webSearchComponent = webSearchSearchable.getSearchActivity(); - if (webSearchComponent != null) { - String componentString = webSearchComponent.flattenToShortString(); - if (Searchables.ENHANCED_GOOGLE_SEARCH_COMPONENT_NAME.equals(componentString) || - Searchables.GOOGLE_SEARCH_COMPONENT_NAME.equals(componentString)) { - showGooglePlaceholder = true; - } - } - } - - mSearchText.setCompoundDrawablesWithIntrinsicBounds( - showGooglePlaceholder ? mGooglePlaceholder : null, null, null, null); - } - - /** * Sets the {@link Launcher} that this gadget will call on to display the search dialog. */ public void setLauncher(Launcher launcher) { mLauncher = launcher; } - // Broadcast receiver for web search provider change notifications - private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - String action = intent.getAction(); - if (SearchManager.INTENT_ACTION_SEARCH_SETTINGS_CHANGED.equals(action)) { - setUpTextField(); - } - } - }; - /** * Moves the view to the top left corner of its parent. */ |