本文整理了Java中android.support.v7.widget.SearchView.requestFocus()
方法的一些代码示例,展示了SearchView.requestFocus()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.requestFocus()
方法的具体详情如下:
包路径:android.support.v7.widget.SearchView
类名称:SearchView
方法名:requestFocus
暂无
代码示例来源:origin: wenhuaijun/EasyImageLoader
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()){
case R.id.action_search:
searchView.setVisibility(View.VISIBLE);
searchView.onActionViewExpanded();
searchView.requestFocus();
break;
case R.id.action_linearLayout:
layoutSysle =Constants.LinearLayoutStyle;
recyclerAdapter.setLayoutManagerType(layoutSysle);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
break;
case R.id.action_stageGridLayout:
layoutSysle =Constants.StagedGridLayoutStyle;
recyclerAdapter.setLayoutManagerType(layoutSysle);
recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
break;
default:
return super.onOptionsItemSelected(item);
}
return true;
}
代码示例来源:origin: szpnygo/NoWordsChat
@Override
protected void onCreateDataBinding() {
super.onCreateDataBinding();
binding = createContentView(R.layout.activity_add_friend);
binding.toolbar.setTitle("添加好友");
setSupportActionBar(binding.toolbar);
setToolbarFinish(binding.toolbar);
binding.setUserBean(UserInfoAction.getUserInfo());
binding.searchView.requestFocus();
binding.searchView.requestFocusFromTouch();
binding.searchView.onActionViewExpanded();
binding.searchView.setSubmitButtonEnabled(true);
binding.searchView.setIconifiedByDefault(false);
binding.searchView.setIconified(false);
binding.searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
if (StringUtil.isEmpty(query)) {
showSnackbarMessage("请输入要查询的无语号");
} else {
search(query);
}
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
return false;
}
});
}
代码示例来源:origin: aint/laverna-android
@Override
public void switchToSearchMode() {
// menuSync.setVisible(false);
// menuAbout.setVisible(false);
// menuSortBy.setVisible(false);
// menuSettings.setVisible(false);
mSearchView.setQueryHint(getString(R.string.fragment_all_notes_menu_search_query_hint));
mSearchView.requestFocus();
Drawable bottomUnderline = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
bottomUnderline = getResources().getDrawable(R.drawable.search_view_bottom_underline, null);
}
mSearchView.setBackground(bottomUnderline);
}
代码示例来源:origin: aint/laverna-android
@Override
public void switchToSearchMode() {
((MainActivity) getActivity()).floatingActionsMenu.collapse();
((MainActivity) getActivity()).floatingActionsMenu.setVisibility(View.GONE);
// TODO: introduce in future milestones
// menuSync.setVisible(false);
// menuAbout.setVisible(false);
// menuSortBy.setVisible(false);
// menuSettings.setVisible(false);
mSearchView.setQueryHint(getString(R.string.fragment_all_notes_menu_search_query_hint));
mSearchView.requestFocus();
Drawable bottomUnderline = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
bottomUnderline = getResources().getDrawable(R.drawable.search_view_bottom_underline, null);
}
mSearchView.setBackground(bottomUnderline);
}
代码示例来源:origin: aint/laverna-android
@Override
public void switchToSearchMode() {
((MainActivity) getActivity()).floatingActionsMenu.collapse();
((MainActivity) getActivity()).floatingActionsMenu.setVisibility(View.GONE);
// TODO: introduce in future milestones
// menuSync.setVisible(false);
// menuAbout.setVisible(false);
// menuSortBy.setVisible(false);
// menuSettings.setVisible(false);
mSearchView.setQueryHint(getString(R.string.fragment_all_notes_menu_search_query_hint));
mSearchView.requestFocus();
Drawable bottomUnderline = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
bottomUnderline = getResources().getDrawable(R.drawable.search_view_bottom_underline, null);
}
mSearchView.setBackground(bottomUnderline);
}
代码示例来源:origin: aint/laverna-android
@Override
public void switchToSearchMode() {
((MainActivity) getActivity()).floatingActionsMenu.collapse();
((MainActivity) getActivity()).floatingActionsMenu.setVisibility(View.GONE);
// TODO: introduce in future milestones
// menuSync.setVisible(false);
// menuAbout.setVisible(false);
// menuSortBy.setVisible(false);
// menuSettings.setVisible(false);
mSearchView.setQueryHint(getString(R.string.fragment_all_notes_menu_search_query_hint));
mSearchView.requestFocus();
Drawable bottomUnderline = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
bottomUnderline = getResources().getDrawable(R.drawable.search_view_bottom_underline, null);
}
mSearchView.setBackground(bottomUnderline);
}
代码示例来源:origin: aint/laverna-android
@Override
public void switchToSearchMode() {
((MainActivity) getActivity()).floatingActionsMenu.collapse();
((MainActivity) getActivity()).floatingActionsMenu.setVisibility(View.GONE);
// TODO: introduce in future milestones
// menuSync.setVisible(false);
// menuAbout.setVisible(false);
// menuSortBy.setVisible(false);
// menuSettings.setVisible(false);
mSearchView.setQueryHint(getString(R.string.fragment_all_notes_menu_search_query_hint));
mSearchView.requestFocus();
Drawable bottomUnderline = null;
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
bottomUnderline = getResources().getDrawable(R.drawable.search_view_bottom_underline, null);
}
mSearchView.setBackground(bottomUnderline);
}
代码示例来源:origin: andforce/iBeebo
searchView.requestFocus();
内容来源于网络,如有侵权,请联系作者删除!