use of android.app.SearchManager in project platform_frameworks_base by android.
the class PhoneWindowManager method launchAssistLongPressAction.
private void launchAssistLongPressAction() {
performHapticFeedbackLw(null, HapticFeedbackConstants.LONG_PRESS, false);
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_ASSIST);
// launch the search activity
Intent intent = new Intent(Intent.ACTION_SEARCH_LONG_PRESS);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
// TODO: This only stops the factory-installed search manager.
// Need to formalize an API to handle others
SearchManager searchManager = getSearchManager();
if (searchManager != null) {
searchManager.stopSearch();
}
startActivityAsUser(intent, UserHandle.CURRENT);
} catch (ActivityNotFoundException e) {
Slog.w(TAG, "No activity to handle assist long press action.", e);
}
}
use of android.app.SearchManager in project Shuttle by timusus.
the class SearchActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_search_activity, menu);
MenuItem searchItem = menu.findItem(R.id.action_search);
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
final SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
final SearchableInfo searchableInfo = searchManager.getSearchableInfo(getComponentName());
if (searchView != null) {
ThemeUtils.themeSearchView(this, searchView);
searchView.setIconified(false);
searchView.setSearchableInfo(searchableInfo);
if (!TextUtils.isEmpty(filterString)) {
searchView.setQuery(filterString, false);
}
}
if (subscriptions == null || subscriptions.isUnsubscribed()) {
subscriptions = new CompositeSubscription();
}
if (searchView != null) {
subscriptions.add(getSearchViewSubscription());
}
return super.onCreateOptionsMenu(menu);
}
use of android.app.SearchManager in project glimmr by brk3.
the class BaseActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main_menu, menu);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
return super.onCreateOptionsMenu(menu);
}
use of android.app.SearchManager in project FBReaderJ by geometer.
the class FBReader method onSearchRequested.
@Override
public boolean onSearchRequested() {
final FBReaderApp.PopupPanel popup = myFBReaderApp.getActivePopup();
myFBReaderApp.hideActivePopup();
if (DeviceType.Instance().hasStandardSearchDialog()) {
final SearchManager manager = (SearchManager) getSystemService(SEARCH_SERVICE);
manager.setOnCancelListener(new SearchManager.OnCancelListener() {
public void onCancel() {
if (popup != null) {
myFBReaderApp.showPopup(popup.getId());
}
manager.setOnCancelListener(null);
}
});
startSearch(myFBReaderApp.MiscOptions.TextSearchPattern.getValue(), true, null, false);
} else {
SearchDialogUtil.showDialog(this, FBReader.class, myFBReaderApp.MiscOptions.TextSearchPattern.getValue(), new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface di) {
if (popup != null) {
myFBReaderApp.showPopup(popup.getId());
}
}
});
}
return true;
}
use of android.app.SearchManager in project Etar-Calendar by Etar-Group.
the class Utils method setUpSearchView.
/**
* This sets up a search view to use Calendar's search suggestions provider
* and to allow refining the search.
*
* @param view The {@link SearchView} to set up
* @param act The activity using the view
*/
public static void setUpSearchView(SearchView view, Activity act) {
SearchManager searchManager = (SearchManager) act.getSystemService(Context.SEARCH_SERVICE);
view.setSearchableInfo(searchManager.getSearchableInfo(act.getComponentName()));
view.setQueryRefinementEnabled(true);
}
Aggregations