Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 325
nmvictor Avatar asked Oct 03 '13 14:10

nmvictor


People also ask

What are Android chips?

Chips are compact elements that represent an attribute, text, entity, or action. They allow users to enter information, select a choice, filter content, or trigger an action.

How do you get the ID of the selected item of the AutoCompleteTextView in Android?

Just call your adapter. getItem(position) and you will get the output you want. For example skillLevelAdapter. getItem(position).

What is AutoCompleteTextView?

An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.


Video Answer


2 Answers

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

like image 172
Scott Kennedy Avatar answered Sep 23 '22 12:09

Scott Kennedy


Two more Chips libraries.

  • Android Chips. Unlike some other this one is updated to have visuals reflecting the newly released "Material Design" standard.

    enter image description here

  • Token Auto Complete. It is an Android Gmail style token auto-complete text field and filter.

    enter image description here
    enter image description here

like image 23
naXa Avatar answered Sep 25 '22 12:09

naXa