Search code examples
javaandroidandroid-edittext

Android AutoCompleteTextView with chips


I am not sure I am using the right words for this UI feature, but I have attached a snapshot of what I am looking to achieve in my app.

Its used by Go SMS, where a user types contacts in an edit text, after the user selects a contact from the completion drop down, the contact is inserted in the edit text as show in the attached image.The edit text is still open to accept further input.

For my app, I would like to do the grouping and insertion as soon as the user enters a comma, Just like the Tag input for StackOverflow works (But I believe I can handle that alone.) My problem is what kind of View is this or how do I modify an EditText to behave like this?

EditText with Grouped Values

Thanks.


Solution

  • The official Chips library from Google (as used in Gmail, Email, Calendar, Messaging) is located at https://android.googlesource.com/platform/frameworks/opt/chips/

    A simple example of how to use it can be found at https://code.google.com/p/platform-features-talk-io-2013/source/browse/src/com/example/iotalk/ChipsActivity.java