use of com.android.ex.chips.BaseRecipientAdapter in project qksms by moezbhatti.
the class AutoCompleteContactView method init.
private void init(Context context) {
mContext = (QKActivity) context;
mAdapter = new BaseRecipientAdapter(BaseRecipientAdapter.QUERY_TYPE_PHONE, getContext());
setThreshold(1);
setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
setAdapter(mAdapter);
setOnItemClickListener(this);
LiveViewManager.registerView(QKPreference.FONT_FAMILY, this, key -> {
setTypeface(FontManager.getFont(mContext));
});
LiveViewManager.registerView(QKPreference.FONT_WEIGHT, this, key -> {
setTypeface(FontManager.getFont(mContext));
});
LiveViewManager.registerView(QKPreference.FONT_SIZE, this, key -> {
setTextSize(TypedValue.COMPLEX_UNIT_SP, FontManager.getTextSize(mContext, FontManager.TEXT_TYPE_PRIMARY));
});
LiveViewManager.registerView(QKPreference.BACKGROUND, this, key -> {
setTextColor(ThemeManager.getTextOnBackgroundPrimary());
setHintTextColor(ThemeManager.getTextOnBackgroundSecondary());
});
LiveViewManager.registerView(QKPreference.MOBILE_ONLY, this, key -> {
if (mAdapter != null) {
SharedPreferences prefs1 = mContext.getPrefs();
mAdapter.setShowMobileOnly(prefs1.getBoolean(SettingsFragment.MOBILE_ONLY, false));
}
});
}
use of com.android.ex.chips.BaseRecipientAdapter in project Etar-Calendar by Etar-Group.
the class EditEventView method initMultiAutoCompleteTextView.
// From com.google.android.gm.ComposeActivity
private MultiAutoCompleteTextView initMultiAutoCompleteTextView(RecipientEditTextView list) {
if (ChipsUtil.supportsChipsUi()) {
mAddressAdapter = new RecipientAdapter(mActivity);
list.setAdapter((BaseRecipientAdapter) mAddressAdapter);
list.setOnFocusListShrinkRecipients(false);
} else {
mAddressAdapter = new EmailAddressAdapter(mActivity);
list.setAdapter((EmailAddressAdapter) mAddressAdapter);
}
list.setTokenizer(new Rfc822Tokenizer());
list.setValidator(mEmailValidator);
// NOTE: assumes no other filters are set
list.setFilters(sRecipientFilters);
return list;
}
Aggregations