本文整理了Java中android.support.v7.widget.SearchView.requestFocusFromTouch()
方法的一些代码示例,展示了SearchView.requestFocusFromTouch()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.requestFocusFromTouch()
方法的具体详情如下:
包路径:android.support.v7.widget.SearchView
类名称:SearchView
方法名:requestFocusFromTouch
暂无
代码示例来源:origin: 0xZhangKe/ShiZhong
private void setupSearchView(final SearchView searchView) {
searchView.setIconified(true);
searchView.setIconifiedByDefault(false);
searchView.setSubmitButtonEnabled(true);
searchView.setFocusable(true);
searchView.requestFocusFromTouch();
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
curQueryText = newText;
search();
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;
}
});
}
内容来源于网络,如有侵权,请联系作者删除!