android.support.v7.widget.SearchView.clearFocus()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(141)

本文整理了Java中android.support.v7.widget.SearchView.clearFocus()方法的一些代码示例,展示了SearchView.clearFocus()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SearchView.clearFocus()方法的具体详情如下:
包路径:android.support.v7.widget.SearchView
类名称:SearchView
方法名:clearFocus

SearchView.clearFocus介绍

暂无

代码示例

代码示例来源:origin: iMeiji/Toutiao

@Override
protected void onPause() {
  super.onPause();
  searchView.clearFocus();
}

代码示例来源:origin: naman14/Timber

public void hideInputManager() {
  if (mSearchView != null) {
    if (mImm != null) {
      mImm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0);
    }
    mSearchView.clearFocus();
    SearchHistory.getInstance(this).addSearchString(queryString);
  }
}

代码示例来源:origin: aa112901/remusic

public void hideInputManager() {
  if (mSearchView != null) {
    if (mImm != null) {
      mImm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0);
    }
    mSearchView.clearFocus();
    SearchHistory.getInstance(this).addSearchString(queryString);
  }
}

代码示例来源:origin: aa112901/remusic

public void hideInputManager() {
  if (mSearchView != null) {
    if (mImm != null) {
      mImm.hideSoftInputFromWindow(mSearchView.getWindowToken(), 0);
    }
    mSearchView.clearFocus();
    SearchHistory.getInstance(this).addSearchString(mSearchView.getQuery().toString());
  }
}

代码示例来源:origin: iMeiji/Toutiao

@Override
  public void onBackPressed() {
    if (suggestionList.getVisibility() != View.GONE) {
      // 关闭搜索建议
      suggestionList.setVisibility(View.GONE);
      hotWordLayout.setVisibility(View.VISIBLE);
    } else if (resultLayout.getVisibility() != View.GONE) {
      // 关闭搜索结果
      searchView.setQuery("", false);
      searchView.clearFocus();
      resultLayout.setVisibility(View.GONE);
      hotWordLayout.setVisibility(View.VISIBLE);
    } else {
      finish();
    }
  }
}

代码示例来源:origin: iMeiji/Toutiao

tv.setTextColor(Color.WHITE);
tv.setOnClickListener(view -> {
  searchView.clearFocus();
  searchView.setQuery(keyWord, true);
});

代码示例来源:origin: iMeiji/Toutiao

Log.d(TAG, "accept: " + keyWord);
if (searchViewQueryTextEvent.isSubmitted()) {
  searchView.clearFocus();
  initSearchLayout(keyWord);
  new Thread(() -> {

代码示例来源:origin: iMeiji/Toutiao

suggestionList.setOnItemClickListener((parent, view, position, id) -> {
  String keyWord = suggestionAdapter.getItem(position).getKeyword();
  searchView.clearFocus();
  searchView.setQuery(keyWord, true);
});
historyList.setOnItemClickListener((parent, view, position, id) -> {
  String keyWord = historyAdapter.getItem(position).getKeyWord();
  searchView.clearFocus();
  searchView.setQuery(keyWord, true);
});

代码示例来源:origin: nisrulz/packagehunter

@Override
public boolean onQueryTextSubmit(String query) {
  searchViewAndroidActionBar.clearFocus();
  return true;
}

代码示例来源:origin: openmrs/openmrs-contrib-android-client

@Override
public boolean onQueryTextSubmit(String query) {
  findPatientView.clearFocus();
  return true;
}

代码示例来源:origin: avluis/Hentoid

@Override
public boolean onMenuItemActionExpand(MenuItem item) {
  setSearchPaneVisibility(true);
  mainSearchView.clearFocus();
  return true;
}

代码示例来源:origin: avluis/Hentoid

@Override
public boolean onQueryTextSubmit(String s) {
  submitContentSearchQuery(s);
  mainSearchView.clearFocus();
  return true;
}

代码示例来源:origin: openmrs/openmrs-contrib-android-client

@Override
public boolean onQueryTextSubmit(String query) {
  searchView.clearFocus();
  return true;
}

代码示例来源:origin: M66B/XPrivacyLua

@Override
public boolean onQueryTextSubmit(String query) {
  Log.i(TAG, "Search submit=" + query);
  if (fragmentMain != null) {
    fragmentMain.filter(query);
    searchView.clearFocus(); // close keyboard
  }
  return true;
}

代码示例来源:origin: CityZenApp/Android-Development

@Override
public void onClick(View view, int position) {
  searchView.clearFocus();
  openDetailedInfo(new ParcelablePOI(adapterElements.get(position)));
}

代码示例来源:origin: AnyChart/AnyChart-Android

@Override
public boolean onQueryTextSubmit(String query) {
  adapter.filter(query);
  searchView.clearFocus();
  return false;
}

代码示例来源:origin: gigabytedevelopers/FireFiles

@Override
public boolean onQueryTextSubmit(String query) {
  mSearchExpanded = mSearchResultShown = true;
  mState.currentSearch = query;
  mSearchView.clearFocus();
  onCurrentDirectoryChanged(ANIM_NONE);
  Bundle params = new Bundle();
  params.putString("query", query);
  AnalyticsManager.logEvent("search", getCurrentRoot(), params);
  return true;
}

代码示例来源:origin: SimonMarquis/Android-PreferencesManager

@Override
public boolean onQueryTextSubmit(String s) {
  Ui.hideSoftKeyboard(getActivity(), mSearchView);
  mSearchView.clearFocus();
  return true;
}

代码示例来源:origin: SimonMarquis/Android-PreferencesManager

@Override
public boolean onQueryTextSubmit(String s) {
  Ui.hideSoftKeyboard(getApplicationContext(), mSearchView);
  mSearchView.clearFocus();
  return true;
}

代码示例来源:origin: NightscoutFoundation/xDrip

private void pushSearch(String query, boolean submit) {
  if (searchItem != null && searchView != null) {
    searchItem.expandActionView();
    searchView.setQuery(query, submit);
    searchView.clearFocus();
  } else {
    UserError.Log.e(TAG, "SearchView is null!");
  }
}

相关文章