@Test public void insertOnSemiColon() { mEditText.append(ALICE.getDisplayName() + ";"); assertEquals(ALICE, mEditText.getContacts().get(0)); }
public ArrayList<Contact> getContacts() { final Editable message = getEditableText(); ImageSpan[] spans = message.getSpans(0, message.length(), ImageSpan.class); Arrays.sort(spans, new Comparator<ImageSpan>() { @Override public int compare(ImageSpan lhs, ImageSpan rhs) { return message.getSpanStart(lhs) - message.getSpanStart(rhs); } }); ArrayList<Contact> contacts = new ArrayList<>(spans.length); for (ImageSpan span : spans) { ExtendedProfileDrawable drawable = (ExtendedProfileDrawable) span.getDrawable(); contacts.add(drawable.getContact()); } return contacts; }
ContactEditText extends AppCompatEditText { public ArrayList<Contact> getContacts() { final Editable message = getEditableText(); ImageSpan[] spans = message.getSpans(0, message.length(), ImageSpan.class); Arrays.sort(spans, new Comparator<ImageSpan>() { @Override public int compare(ImageSpan lhs, ImageSpan rhs) { return message.getSpanStart(lhs) - message.getSpanStart(rhs); } }); ArrayList<Contact> contacts = new ArrayList<>(spans.length); for (ImageSpan span : spans) { ExtendedProfileDrawable drawable = (ExtendedProfileDrawable) span.getDrawable(); contacts.add(drawable.getContact()); } return contacts; } }
ContactEditText extends AppCompatEditText { public ArrayList<Contact> getContacts() { final Editable message = getEditableText(); ImageSpan[] spans = message.getSpans(0, message.length(), ImageSpan.class); Arrays.sort(spans, new Comparator<ImageSpan>() { @Override public int compare(ImageSpan lhs, ImageSpan rhs) { return message.getSpanStart(lhs) - message.getSpanStart(rhs); } }); ArrayList<Contact> contacts = new ArrayList<>(spans.length); for (ImageSpan span : spans) { ExtendedProfileDrawable drawable = (ExtendedProfileDrawable) span.getDrawable(); contacts.add(drawable.getContact()); } return contacts; } ContactEditText(Context context);  ContactEditText(Context context, AttributeSet attrs);  ContactEditText(Context context, AttributeSet attrs, int defStyle); }
ContactEditText extends AppCompatEditText { public ArrayList<Contact> getContacts() { final Editable message = getEditableText(); ImageSpan[] spans = message.getSpans(0, message.length(), ImageSpan.class); Arrays.sort(spans, new Comparator<ImageSpan>() { @Override public int compare(ImageSpan lhs, ImageSpan rhs) { return message.getSpanStart(lhs) - message.getSpanStart(rhs); } }); ArrayList<Contact> contacts = new ArrayList<>(spans.length); for (ImageSpan span : spans) { ExtendedProfileDrawable drawable = (ExtendedProfileDrawable) span.getDrawable(); contacts.add(drawable.getContact()); } return contacts; } ContactEditText(Context context);  ContactEditText(Context context, AttributeSet attrs);  ContactEditText(Context context, AttributeSet attrs, int defStyle); void insert(Contact contact); void insertPendingText(); String getPendingText(); ArrayList<Contact> getContacts(); void setContacts(Collection<Contact> contacts); }
ContactEditText extends AppCompatEditText { public ArrayList<Contact> getContacts() { final Editable message = getEditableText(); ImageSpan[] spans = message.getSpans(0, message.length(), ImageSpan.class); Arrays.sort(spans, new Comparator<ImageSpan>() { @Override public int compare(ImageSpan lhs, ImageSpan rhs) { return message.getSpanStart(lhs) - message.getSpanStart(rhs); } }); ArrayList<Contact> contacts = new ArrayList<>(spans.length); for (ImageSpan span : spans) { ExtendedProfileDrawable drawable = (ExtendedProfileDrawable) span.getDrawable(); contacts.add(drawable.getContact()); } return contacts; } ContactEditText(Context context);  ContactEditText(Context context, AttributeSet attrs);  ContactEditText(Context context, AttributeSet attrs, int defStyle); void insert(Contact contact); void insertPendingText(); String getPendingText(); ArrayList<Contact> getContacts(); void setContacts(Collection<Contact> contacts);  }