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

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

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

AutoCompleteTextView.setInputType介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

AutoCompleteTextView t = (AutoCompleteTextView)v.findViewById(id);
t.setInputType( t.getInputType() & (~EditorInfo.TYPE_TEXT_FLAG_AUTO_COMPLETE) );

代码示例来源:origin: Attriumph/Place-Search-Service

@Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
    if (checkedId == R.id.current_location){
      mPlaceSearchLocation.setText("");
      Log.v("try to clear location",mPlaceSearchLocation.getText().toString());
      mRequestingLocationUpdates = true;
      startLocationUpdates();
      locationReminder.setVisibility(View.GONE);
      mPlaceSearchLocation.setInputType(EditorInfo.TYPE_NULL);
    }else if (checkedId==R.id.other_location){
      mPlaceSearchLocation.setInputType(EditorInfo.TYPE_CLASS_TEXT);
    }
  }
}

代码示例来源:origin: yidun/captcha-android-demo

private void initLoginView() {
  text_email = (AutoCompleteTextView) findViewById(R.id.text_email);
  edit_password = (EditText) findViewById(R.id.edit_password);
  button_login = (Button) findViewById(R.id.button_login);
  text_email.setText("dev@dun.163.com");
  text_email.setInputType(InputType.TYPE_NULL);
  edit_password.setText("******");
  edit_password.setInputType(InputType.TYPE_NULL);
}

代码示例来源:origin: stackoverflow.com

private SearchView getSearchView() {
  SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
  SearchView searchView = new SearchView(getSupportActionBar().getThemedContext());
  searchView.setQueryHint("Search for items");
  searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));

  AutoCompleteTextView searchTextView =
      (AutoCompleteTextView) searchView.findViewById(R.id.abs__search_src_text);
  if (searchTextView != null) {
    searchTextView.setInputType(InputType.TYPE_CLASS_TEXT
                  | InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
    searchTextView.setTypeface(Typeface.DEFAULT);
  }
  return searchView;
}

代码示例来源:origin: AEFeinstein/mtg-familiar

mNameField.setOnEditorActionListener(addCardListener);
mNameField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

代码示例来源:origin: AEFeinstein/mtg-familiar

mNameField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mArtistField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mWatermarkField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mSupertypeField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
mSubtypeField.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

代码示例来源:origin: derry/delion

mInput.setInputType(InputType.TYPE_CLASS_PHONE);
  break;
case EditorFieldModel.INPUT_TYPE_HINT_EMAIL:
  mInput.setInputType(InputType.TYPE_CLASS_TEXT
      | InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS);
  break;
  mInput.setInputType(InputType.TYPE_CLASS_TEXT
      | InputType.TYPE_TEXT_FLAG_CAP_WORDS
      | InputType.TYPE_TEXT_FLAG_MULTI_LINE
  break;
case EditorFieldModel.INPUT_TYPE_HINT_PERSON_NAME:
  mInput.setInputType(InputType.TYPE_CLASS_TEXT
      | InputType.TYPE_TEXT_FLAG_CAP_WORDS
      | InputType.TYPE_TEXT_VARIATION_PERSON_NAME);
  break;
case EditorFieldModel.INPUT_TYPE_HINT_REGION:
  mInput.setInputType(InputType.TYPE_CLASS_TEXT
      | InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS
      | InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS);
  mInput.setInputType(InputType.TYPE_CLASS_TEXT
      | InputType.TYPE_TEXT_FLAG_CAP_WORDS
      | InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS);

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

private void initAutoCompleteFilter(final AutoCompleteTextView filterTxt) { // init only after it's toggled
  autoCompleteAdapter = TransactionUtils.createCategoryFilterAdapter(activity, db);
  filterTxt.setInputType(InputType.TYPE_CLASS_TEXT 
          | InputType.TYPE_TEXT_FLAG_CAP_WORDS 
          | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
          | InputType.TYPE_TEXT_VARIATION_FILTER);
  filterTxt.setThreshold(1);
  filterTxt.setOnFocusChangeListener((view, hasFocus) -> {
    if (hasFocus) {
      filterTxt.setAdapter(requireNonNull(autoCompleteAdapter));
      filterTxt.selectAll();
    }
  });
  filterTxt.setOnItemClickListener((parent, view, position, id) -> {
    activity.onSelectedId(R.id.category, id);
    ToggleButton toggleBtn = (ToggleButton) filterTxt.getTag();
    toggleBtn.performClick();
  });
}

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

private void initAutoCompleteFilter(final AutoCompleteTextView filterTxt) {
  filterAdapter = createFilterAdapter();
  filterTxt.setInputType(InputType.TYPE_CLASS_TEXT
      | InputType.TYPE_TEXT_FLAG_CAP_WORDS
      | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS
      | InputType.TYPE_TEXT_VARIATION_FILTER);
  filterTxt.setThreshold(1);
  filterTxt.setOnFocusChangeListener((view, hasFocus) -> {
    if (hasFocus) {
      filterTxt.setAdapter(filterAdapter);
      filterTxt.selectAll();
    }
  });
  filterTxt.setOnItemClickListener((parent, view, position, id) -> {
    activity.onSelectedId(layoutId, id);
    ToggleButton toggleBtn = (ToggleButton) filterTxt.getTag();
    toggleBtn.performClick();
  });
}

代码示例来源:origin: WowzaMediaSystems/gocoder-sdk-samples-android

mAutoCompleteEditText.setInputType(editText.getInputType());
mAutoCompleteEditText.setKeyListener(editText.getKeyListener());
mAutoCompleteEditText.setMaxLines(editText.getMaxLines());

相关文章

AutoCompleteTextView类方法