@Override public final CharSequence convertToString(Cursor cursor) { CharSequence number = ContactsWrapper.getInstance().transformToSipUri(mContext, cursor); if (!TextUtils.isEmpty(number)) { return Filter.rewritePhoneNumber(mContext, currentAccId, number.toString()); } return number; }
public ContactAdapter(Context context, Cursor c) { super(context, R.layout.contact_phone_list_item, c, new String[] {}, new int[] {}); alphaIndexer = new AlphabetIndexer( c, ContactsWrapper.getInstance().getContactIndexableColumnIndex(c), " ABCDEFGHIJKLMNOPQRSTUVWXYZ"); }
public EditSipUri(Context context, AttributeSet attrs) { super(context, attrs); setGravity(Gravity.CENTER_HORIZONTAL); setOrientation(VERTICAL); LayoutInflater inflater = LayoutInflater.from(context); inflater.inflate(R.layout.edit_sip_uri, this, true); dialUser = (AutoCompleteTextView) findViewById(R.id.dialtxt_user); accountChooserButtonText = (AccountChooserButton) findViewById(R.id.accountChooserButtonText); domainTextHelper = (TextView) findViewById(R.id.dialtxt_domain_helper); completeList = (ListView) findViewById(R.id.autoCompleteList); autoCompleteAdapter = new ContactsAutocompleteAdapter(context); // Map events accountChooserButtonText.setOnAccountChangeListener( new OnAccountChangeListener() { @Override public void onChooseAccount(SipProfile account) { updateDialTextHelper(); long accId = SipProfile.INVALID_ID; if (account != null) { accId = account.id; } autoCompleteAdapter.setSelectedAccount(accId); } }); dialUser.addTextChangedListener(this); if (isInEditMode()) { // Don't bind cursor in this case return; } Cursor c = ContactsWrapper.getInstance().getContactsPhones(context); contactsAdapter = new ContactAdapter(context, c); completeList.setAdapter(contactsAdapter); completeList.setOnItemClickListener(this); dialUser.setAdapter(autoCompleteAdapter); }
@Override public Cursor runQueryOnBackgroundThread(CharSequence constraint) { return ContactsWrapper.getInstance().searchContact(mContext, constraint); }
@Override public final void bindView(View view, Context context, Cursor cursor) { ContactsWrapper.getInstance().bindAutoCompleteView(view, context, cursor); }
@Override public void bindView(View view, Context context, Cursor cursor) { super.bindView(view, context, cursor); ContactsWrapper.getInstance().bindContactPhoneView(view, context, cursor); }