本文整理汇总了Java中android.support.v7.widget.AppCompatMultiAutoCompleteTextView类的典型用法代码示例。如果您正苦于以下问题:Java AppCompatMultiAutoCompleteTextView类的具体用法?Java AppCompatMultiAutoCompleteTextView怎么用?Java AppCompatMultiAutoCompleteTextView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppCompatMultiAutoCompleteTextView类属于android.support.v7.widget包,在下文中一共展示了AppCompatMultiAutoCompleteTextView类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: editTags
import android.support.v7.widget.AppCompatMultiAutoCompleteTextView; //导入依赖的package包/类
public void editTags(Activity activity) {
final LayoutInflater inflater = activity.getLayoutInflater();
final View view = inflater.inflate(R.layout.dialog_tags, null);
final AppCompatMultiAutoCompleteTextView edt = (AppCompatMultiAutoCompleteTextView) view.getRootView();
final AlertDialog dlg_tags = new AlertDialog.Builder(activity).setTitle(R.string.tagact_title)
.setView(view).setCancelable(true).setNegativeButton(R.string.dlg_btn_cancel, null)
.setPositiveButton(R.string.dlg_btn_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
setTags(edt.getText().toString().split(",\\s*"));
}
}).create();
final ArrayAdapter<String> adapter = new ArrayAdapter<String>(activity.getApplicationContext(),
android.R.layout.simple_dropdown_item_1line, session.getAllTags());
edt.setAdapter(adapter);
edt.setTokenizer(new AppCompatMultiAutoCompleteTextView.CommaTokenizer());
edt.setThreshold(1);
edt.setDropDownBackgroundResource(R.color.textColorNormal);
edt.setText(TextUtils.join(", ", tags));
edt.setHint(R.string.tagact_hint);
dlg_tags.show();
}
示例2: getDefaultViewDefStyleAttr
import android.support.v7.widget.AppCompatMultiAutoCompleteTextView; //导入依赖的package包/类
@SuppressLint({"PrivateResource", "InlinedApi"})
@Override
protected int getDefaultViewDefStyleAttr(View view) {
if (view instanceof AppCompatRadioButton) {
return R.attr.radioButtonStyle;
} else if (view instanceof AppCompatCheckBox) {
return R.attr.checkboxStyle;
} else if (view instanceof AppCompatButton) {
return R.attr.buttonStyle;
} else if (view instanceof AppCompatMultiAutoCompleteTextView) {
return R.attr.autoCompleteTextViewStyle;
} else if (view instanceof AppCompatAutoCompleteTextView) {
return R.attr.autoCompleteTextViewStyle;
} else if (view instanceof AppCompatEditText) {
return R.attr.editTextStyle;
} else if (view instanceof AppCompatCheckedTextView) {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ?
android.R.attr.checkedTextViewStyle : 0;
} else if (view instanceof AppCompatTextView) {
return android.R.attr.textViewStyle;
} else if (view instanceof AppCompatSpinner) {
return R.attr.spinnerStyle;
} else if (view instanceof AppCompatImageButton) {
return R.attr.imageButtonStyle;
} else if (view instanceof AppCompatRatingBar) {
return R.attr.ratingBarStyle;
} else if (view instanceof AppCompatSeekBar) {
return R.attr.seekBarStyle;
} else {
return super.getDefaultViewDefStyleAttr(view);
}
}