<!-- Global search icon -->
<LinearLayout
style="@style/SearchButton"
- android:layout_width="wrap_content"
+ android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
private void updateGlobalSearchIcon() {
final ImageView searchButton = (ImageView) findViewById(R.id.search_button);
final View searchDivider = findViewById(R.id.search_divider);
+ final View voiceButton = findViewById(R.id.voice_button);
final SearchManager searchManager =
(SearchManager) getSystemService(Context.SEARCH_SERVICE);
searchButton.setVisibility(View.VISIBLE);
if (searchDivider != null) searchDivider.setVisibility(View.VISIBLE);
} else {
+ // We disable both search and voice search when there is no global search provider
searchButton.setVisibility(View.GONE);
if (searchDivider != null) searchDivider.setVisibility(View.GONE);
+ voiceButton.setVisibility(View.GONE);
}
}
filter = new IntentFilter();
filter.addAction(SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED);
registerReceiver(mModel, filter);
+ filter = new IntentFilter();
+ filter.addAction(SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED);
+ registerReceiver(mModel, filter);
// Register for changes to the favorites
ContentResolver resolver = getContentResolver();
mAllAppsLoaded = false;
mWorkspaceLoaded = false;
startLoaderFromBackground();
- } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action)) {
+ } else if (SearchManager.INTENT_GLOBAL_SEARCH_ACTIVITY_CHANGED.equals(action) ||
+ SearchManager.INTENT_ACTION_SEARCHABLES_CHANGED.equals(action)) {
Callbacks callbacks = mCallbacks.get();
callbacks.bindSearchablesChanged();
}