android.widget.AutoCompleteTextView.setFocusableInTouchMode()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(126)

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

AutoCompleteTextView.setFocusableInTouchMode介绍

暂无

代码示例

代码示例来源:origin: posm/OpenMapKitAndroid

@Override
  public void onClick(View view) {
    if (editTextCheckBox.isChecked()) {
      editText.setFocusableInTouchMode(true);
      editText.requestFocus();
      final InputMethodManager inputMethodManager = (InputMethodManager) activity
          .getSystemService(Context.INPUT_METHOD_SERVICE);
      inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
    }
  }
});

代码示例来源:origin: posm/OpenMapKitAndroid

@Override
  public void onClick(View view) {
    if (customButton.isChecked()) {
      customEditText.setFocusableInTouchMode(true);
      customEditText.requestFocus();
      final InputMethodManager inputMethodManager = (InputMethodManager) activity
          .getSystemService(Context.INPUT_METHOD_SERVICE);
      inputMethodManager.showSoftInput(customEditText, InputMethodManager.SHOW_IMPLICIT);
    }
  }
});

代码示例来源:origin: TongmingWu/Manga

@Override
  public boolean onTouch(View v, MotionEvent event) {
    etSearch.setFocusable(true);
    etSearch.setFocusableInTouchMode(true);
    etSearch.requestFocus();
    String word = etSearch.getText().toString().trim();
    editHint(word);
    return false;
  }
});

代码示例来源:origin: q805699513/OptionFrame

public void setContentView(View contentView) {
  ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(
      ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  contentView.setLayoutParams(layoutParams);
  if (contentView instanceof ListView) {
    setListViewHeightBasedOnChildren((ListView) contentView);
  }
  LinearLayout linearLayout = (LinearLayout) mAlertDialogWindow.findViewById(
      R.id.message_content_view);
  if (linearLayout != null) {
    linearLayout.removeAllViews();
    linearLayout.addView(contentView);
  }
  for (int i = 0; i < (linearLayout != null ? linearLayout.getChildCount() : 0); i++) {
    if (linearLayout.getChildAt(i) instanceof AutoCompleteTextView) {
      AutoCompleteTextView autoCompleteTextView
          = (AutoCompleteTextView) linearLayout.getChildAt(i);
      autoCompleteTextView.setFocusable(true);
      autoCompleteTextView.requestFocus();
      autoCompleteTextView.setFocusableInTouchMode(true);
    }
  }
}

代码示例来源:origin: szpnygo/NoWordsChat

public void setContentView(View contentView) {
  ViewGroup.LayoutParams layoutParams = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  contentView.setLayoutParams(layoutParams);
  if (contentView instanceof ListView) {
    setListViewHeightBasedOnChildren((ListView) contentView);
  }
  LinearLayout linearLayout = (LinearLayout) mAlertDialogWindow.findViewById(R.id.message_content_view);
  if (linearLayout != null) {
    linearLayout.removeAllViews();
    linearLayout.addView(contentView);
  }
  for (int i = 0; i < linearLayout.getChildCount(); i++) {
    if (linearLayout.getChildAt(i) instanceof AutoCompleteTextView) {
      AutoCompleteTextView autoCompleteTextView = (AutoCompleteTextView) linearLayout.getChildAt(i);
      autoCompleteTextView.setFocusable(true);
      autoCompleteTextView.requestFocus();
      autoCompleteTextView.setFocusableInTouchMode(true);
    }
  }
}

代码示例来源:origin: szpnygo/NoWordsChat

autoCompleteTextView.setFocusable(true);
autoCompleteTextView.requestFocus();
autoCompleteTextView.setFocusableInTouchMode(true);

代码示例来源:origin: q805699513/OptionFrame

autoCompleteTextView.setFocusable(true);
autoCompleteTextView.requestFocus();
autoCompleteTextView.setFocusableInTouchMode(true);

代码示例来源:origin: dsolonenko/financisto

public ListBuilder withAutoCompleteFilter(OnClickListener listener, int toggleId) {
  final AutoCompleteTextView autoCompleteTxt = v.findViewById(R.id.autocomplete_filter);
  autoCompleteTxt.setFocusableInTouchMode(true);
  
  ToggleButton toggleBtn = v.findViewById(R.id.filterToggle);
  toggleBtn.setId(toggleId);
  toggleBtn.setOnClickListener(v1 -> {
    listener.onClick(v1);
    boolean filterVisible = toggleBtn.isChecked();
    autoCompleteTxt.setVisibility(filterVisible ? VISIBLE : GONE);
    v.findViewById(R.id.list_node_row).setVisibility(filterVisible ? GONE : VISIBLE);
    if (filterVisible) {
      autoCompleteTxt.setText("");
      Utils.openSoftKeyboard(autoCompleteTxt, layout.getContext());
    } else {
      Utils.closeSoftKeyboard(autoCompleteTxt, layout.getContext());
    }
  });
  return this;
}

相关文章

AutoCompleteTextView类方法