本文整理了Java中android.widget.AutoCompleteTextView.getContext()
方法的一些代码示例,展示了AutoCompleteTextView.getContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AutoCompleteTextView.getContext()
方法的具体详情如下:
包路径:android.widget.AutoCompleteTextView
类名称:AutoCompleteTextView
方法名:getContext
暂无
代码示例来源:origin: square/assertj-android
public AutoCompleteTextViewAssert hasCompletionHint(int resId) {
isNotNull();
return hasCompletionHint(actual.getContext().getString(resId));
}
代码示例来源:origin: rey5137/material
TypedArray a = v.getContext().obtainStyledAttributes(attrs, R.styleable.AutoCompleteTextView, defStyleAttr, defStyleRes);
代码示例来源:origin: tomahawk-player/tomahawk-android
public SearchViewStyle setCursorColor(final int color) {
final AutoCompleteTextView editText = getView(
android.support.v7.appcompat.R.id.search_src_text);
if (editText != null) {
try {
final Field fCursorDrawableRes = TextView.class
.getDeclaredField("mCursorDrawableRes");
fCursorDrawableRes.setAccessible(true);
final int mCursorDrawableRes = fCursorDrawableRes.getInt(editText);
final Field fEditor = TextView.class.getDeclaredField("mEditor");
fEditor.setAccessible(true);
final Object editor = fEditor.get(editText);
final Class<?> clazz = editor.getClass();
final Field fCursorDrawable = clazz.getDeclaredField("mCursorDrawable");
fCursorDrawable.setAccessible(true);
final Drawable[] drawables = new Drawable[2];
drawables[0] = editText.getContext().getResources().getDrawable(mCursorDrawableRes);
drawables[1] = editText.getContext().getResources().getDrawable(mCursorDrawableRes);
drawables[0].setColorFilter(color, PorterDuff.Mode.SRC_IN);
drawables[1].setColorFilter(color, PorterDuff.Mode.SRC_IN);
fCursorDrawable.set(editor, drawables);
} catch (final Throwable ignored) {
}
}
return this;
}
代码示例来源:origin: com.squareup.assertj/assertj-android
public AutoCompleteTextViewAssert hasCompletionHint(int resId) {
isNotNull();
return hasCompletionHint(actual.getContext().getString(resId));
}
代码示例来源:origin: stackoverflow.com
new ArrayAdapter<String>(_textView.getContext(),
android.R.layout.simple_list_item_1, result);
_textView.setAdapter(adapter);
代码示例来源:origin: playerone-id/EosCommander
public static void setupAccountHistory( AutoCompleteTextView... autoTextViewArray ) {
for ( AutoCompleteTextView actv : autoTextViewArray ) {
AccountAdapter adapter = new AccountAdapter(actv.getContext(), R.layout.account_suggestion, R.id.eos_account);
if (actv instanceof MultiAutoCompleteTextView) {
((MultiAutoCompleteTextView) actv).setTokenizer(new WhitSpaceTokenizer());
}
actv.setThreshold(1);
actv.setAdapter(adapter);
}
}
内容来源于网络,如有侵权,请联系作者删除!