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

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

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

SearchView.setVisibility介绍

暂无

代码示例

代码示例来源:origin: JZ-Darkal/AndroidHttpCapture

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
             Bundle savedInstanceState) {
  // Inflate the layout for this fragment
  View view = inflater.inflate(R.layout.fragment_preview, container, false);
  ButterKnife.bind(this, view);
  if(SysApplication.isInitProxy) {
    harLog = ((SysApplication) getActivity().getApplication()).proxy.getHar().getLog();
    harEntryList.addAll(harLog.getEntries());
  }
  recyclerView.addItemDecoration(new RecycleViewDivider(getActivity(), RecycleViewDivider.VERTICAL_LIST));
  recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
  recyclerView.setAdapter(previewAdapter = new PreviewAdapter());
  if(((MainActivity) getActivity()).searchView!=null){
    ((MainActivity) getActivity()).searchView.setVisibility(View.VISIBLE);
  }
  return view;
}

代码示例来源:origin: mayubao/KuaiChuan

/**
 * 初始化
 */
private void init(){
  tv_title.setText(getResources().getString(R.string.title_choose_file));
  tv_title.setVisibility(View.VISIBLE);
  iv_search.setVisibility(View.INVISIBLE);
  search_view.setVisibility(View.GONE);
  mIsWebTransfer = getIntent().getBooleanExtra(Constant.KEY_WEB_TRANSFER_FLAG, false);
  //Android6.0 requires android.permission.READ_EXTERNAL_STORAGE
  //TODO
  if (ContextCompat.checkSelfPermission(getContext(), Manifest.permission.READ_EXTERNAL_STORAGE)
      != PackageManager.PERMISSION_GRANTED) {
    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_CODE_GET_FILE_INFOS);
  }else{
    initData();//初始化数据
  }
}

代码示例来源:origin: tangqi92/BuildingBlocks

@Override
public boolean onQueryTextSubmit(String query) {
  /**
   * hides and then unhides search tab to make sure
   * keyboard disappears when query is submitted
   */
  if (searchView != null) {
    searchView.setVisibility(View.INVISIBLE);
    searchView.setVisibility(View.VISIBLE);
  }
  return false;
}

代码示例来源:origin: wenhuaijun/EasyImageLoader

@Override
public boolean onQueryTextSubmit(String query) {
  recyclerAdapter.clear();
  searchPicture(query);
  searchView.setVisibility(View.GONE);
  recyclerView.requestFocus();
  toolbar.setTitle(query);
  return false;
}

代码示例来源: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: avluis/Hentoid

/**
 * Handler for Attribute type button click
 *
 * @param button Button that has been clicked on
 */
private void selectAttrButton(ImageButton button)
{
  selectedTab = (AttributeType)button.getTag();
  // Reset color of every tab
  for (View v : attrSelector.getTouchables()) v.setBackgroundResource(R.drawable.btn_attribute_section_off);
  // Set color of selected tab
  button.setBackgroundResource(R.drawable.btn_attribute_section_on);
  // Set hint on search bar
  SearchView tagSearchView = searchPane.findViewById(R.id.tag_filter);
  tagSearchView.setVisibility(View.VISIBLE);
  tagSearchView.setQuery("", false);
  tagSearchView.setQueryHint("Search " + selectedTab.name().toLowerCase());
  // Remove previous tag suggestions
  attributeMosaic.removeAllViews();
  // Run search
  searchMasterData(selectedTab, "");
}

相关文章