use of android.support.v7.widget.SearchView in project actor-platform by actorapp.
the class SearchViewHacker method setEditText.
public static void setEditText(SearchView searchView, int resId) {
View autoComplete = findView(searchView, "mSearchPlate");
autoComplete.setBackgroundResource(resId);
}
use of android.support.v7.widget.SearchView in project materialistic by hidroh.
the class FavoriteFragment method createSearchView.
private void createSearchView(MenuItem menuSearch) {
final SearchView searchView = (SearchView) mActionViewResolver.getActionView(menuSearch);
searchView.setQueryHint(getString(R.string.hint_search_saved_stories));
searchView.setSearchableInfo(((SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE)).getSearchableInfo(getActivity().getComponentName()));
searchView.setIconified(!mSearchViewExpanded);
searchView.setQuery(mFilter, false);
searchView.setOnSearchClickListener(v -> {
mSearchViewExpanded = true;
v.requestFocus();
});
searchView.setOnCloseListener(() -> {
// trigger a dummy empty search intent, as empty query does not get submitted
searchView.setQuery(FavoriteActivity.EMPTY_QUERY, true);
return false;
});
}
use of android.support.v7.widget.SearchView in project materialistic by hidroh.
the class BaseListActivity method onCreateOptionsMenu.
@Override
public boolean onCreateOptionsMenu(Menu menu) {
if (mIsMultiPane) {
getMenuInflater().inflate(R.menu.menu_item_compact, menu);
}
if (isSearchable()) {
getMenuInflater().inflate(R.menu.menu_search, menu);
MenuItem menuSearch = menu.findItem(R.id.menu_search);
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) mActionViewResolver.getActionView(menuSearch);
searchView.setSearchableInfo(searchManager.getSearchableInfo(new ComponentName(this, SearchActivity.class)));
searchView.setIconified(true);
searchView.setQuery("", false);
}
return super.onCreateOptionsMenu(menu);
}
use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.
the class TestOfCandyBar method onCreate.
@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.general);
toolbar = (Toolbar) findViewById(R.id.toolbar);
try {
worker = CandyBar.Builder.with(this).companyLogo(R.drawable.starz_logo).searchView(LayoutAsset.classic_3).searchBarEvents(new SimpleSearchCallBack() {
@Override
public void onKeySearchStartConfirm(String text) {
Log.d("start", text);
}
@Override
public void onKeySearchLetter(String text) {
Log.d("start", text);
}
@Override
public void onRestoreToNormal(ActionBar toolbar) {
worker.showBack();
}
}).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.cross_grey, R.mipmap.ic_action_close, R.mipmap.crossmp).background(R.drawable.bottom_line).presetCountNotification(u).build(toolbar);
} catch (Exception e) {
e.printStackTrace();
}
//show title
Button b1 = (Button) findViewById(R.id.b1);
//how main bar
Button b2 = (Button) findViewById(R.id.b2);
//show search bar
Button b3 = (Button) findViewById(R.id.b3);
//other function
Button b4 = (Button) findViewById(R.id.b4);
//other function
Button b5 = (Button) findViewById(R.id.b5);
//other function
Button bxx = (Button) findViewById(R.id.bxx);
b1.setOnClickListener(this);
b2.setOnClickListener(this);
b3.setOnClickListener(this);
b4.setOnClickListener(this);
b5.setOnClickListener(this);
bxx.setOnClickListener(this);
}
use of android.support.v7.widget.SearchView in project ToolBarLib by jjhesk.
the class TestOfCandyBar2Icons method onCreate.
@SuppressLint("ResourceAsColor")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.general);
toolbar = (Toolbar) findViewById(R.id.toolbar);
try {
worker = CandyBar.Builder.with(this).companyLogo(R.drawable.starz_logo).searchView(LayoutAsset.classic_3).searchBarEvents(new commonSearchBarMgr() {
@Override
public void onKeySearchStartConfirm(String text) {
Log.d("start", text);
}
@Override
public void onKeySearchLetter(String text) {
Log.d("start", text);
}
@Override
public void onRestoreToNormal(ActionBar toolbar) {
worker.showBack();
}
@Override
public void onPressSearchButton(ActionBar toolbar) {
Log.d("addNow", toolbar.toString());
}
}).setNotifcationTextColor(R.color.main_background).setNotificationOffset(15).setNotificationDrawableId(R.drawable.notg).overrideIcons(R.mipmap.ic_action_close, R.mipmap.crossmp).background(R.drawable.bottom_line).presetCountNotification(u).build(toolbar);
} catch (Exception e) {
e.printStackTrace();
}
//show title
Button b1 = (Button) findViewById(R.id.b1);
//how main bar
Button b2 = (Button) findViewById(R.id.b2);
//show search bar
Button b3 = (Button) findViewById(R.id.b3);
//other function
Button b4 = (Button) findViewById(R.id.b4);
//other function
Button b5 = (Button) findViewById(R.id.b5);
//other function
Button bx = (Button) findViewById(R.id.bxx);
bx.setText("close this App");
b1.setOnClickListener(this);
b2.setOnClickListener(this);
b3.setOnClickListener(this);
b4.setOnClickListener(this);
b5.setOnClickListener(this);
bx.setOnClickListener(this);
}
Aggregations