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

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

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

AutoCompleteTextView.setEnabled介绍

暂无

代码示例

代码示例来源:origin: zulip/zulip-android

/**
 * Disable chatBox and show a loading footer while sending the message.
 */
private void sendingMessage(boolean isSending, String message) {
  streamActv.setEnabled(!isSending);
  textView.setEnabled(!isSending);
  messageEt.setEnabled(!isSending);
  topicActv.setEnabled(!isSending);
  sendBtn.setEnabled(!isSending);
  addFileBtn.setEnabled(!isSending);
  togglePrivateStreamBtn.setEnabled(!isSending);
  if (isSending) {
    TextView msg = (TextView) composeStatus.findViewById(R.id.sending_message);
    msg.setText(message);
    composeStatus.setVisibility(View.VISIBLE);
  } else
    composeStatus.setVisibility(View.GONE);
}

代码示例来源:origin: zulip/zulip-android

/**
 * Switch from Private to Stream or vice versa in chatBox
 */
private void switchView() {
  if (isCurrentModeStream()) { //Person
    togglePrivateStreamBtn.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_action_bullhorn));
    tempStreamSave = topicActv.getText().toString();
    topicActv.setText(null);
    topicActv.setHint(R.string.hint_person);
    topicActv.setAdapter(emailActvAdapter);
    streamActv.setVisibility(View.GONE);
    textView.setVisibility(View.GONE);
  } else { //Stream
    topicActv.setText(tempStreamSave);
    togglePrivateStreamBtn.setImageDrawable(ContextCompat.getDrawable(this, R.drawable.ic_action_person));
    streamActv.setEnabled(true);
    topicActv.setHint(R.string.hint_subject);
    streamActv.setHint(R.string.hint_stream);
    streamActv.setVisibility(View.VISIBLE);
    textView.setVisibility(View.VISIBLE);
    topicActv.setVisibility(View.VISIBLE);
    streamActv.setAdapter(streamActvAdapter);
    topicActv.setAdapter(subjectActvAdapter);
  }
}

代码示例来源:origin: wasdennnoch/AndroidN-ify

public AutoCompleteEditTextPreference(Context context, AttributeSet attrs, int defStyleAttr,
                   int defStyleRes) {
  super(context, attrs, defStyleAttr, defStyleRes);
  mAutoCompleteTextView = new InstantAutoCompleteTextView(context, attrs);
  // Give it an ID so it can be saved/restored
  mAutoCompleteTextView.setId(R.id.edit);
  /*
   * The preference framework and view framework both have an 'enabled'
   * attribute. Most likely, the 'enabled' specified in this XML is for
   * the preference framework, but it was also given to the view framework.
   * We reset the enabled state.
   */
  mAutoCompleteTextView.setEnabled(true);
  mAutoCompleteTextView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
      if (actionId == EditorInfo.IME_ACTION_DONE) {
        onClick(getDialog(), DialogInterface.BUTTON_POSITIVE);
        getDialog().dismiss();
        return true;
      }
      return false;
    }
  });
  setDialogLayoutResource(R.layout.preference_dialog_autocomplete_edittext);
}

相关文章

AutoCompleteTextView类方法