Home

Awesome

Note: this is deprecated. Google made better solution for it in its Material-design SDK:


ChipsLibrary

This is a fork of Google's chips library shown here, and can be downloaded from here

screenshot

What's different from the original library :

  1. It's easy to import and build on Eclipse. :)

  2. Removed buggy dragging feature and the classes it uses.

  3. fixed setOnItemClickListener (for clicking on chips) so that it will use both the chips library's logic AND your code.

  4. Removed T9 searching for phones, and instead you can search for either phone numbers or names, by exactly what you type. Of course, you can always revert back to what Google has done, if you wish.

  5. Added features :

  6. getRecipients - query all recipients (should usually be done on a background thread)

  7. addRecipient , removeRecipient - adds/removes a recipient. also, ability to control if you wish to be notified about chips added/removed when you are the one who triggered it.

  8. setChipListener - sets a listener that'll notify you when the number of chips has changed.

  9. setFocusBehavior - ability to choose what to do when focus removed/received.

  10. New CTOR for the BaseRecipientAdapter, which allows to choose which recipients to use . Note that this is only for demonstrations

  11. setChosenRecipients - ability to set all chosen recipients.

  12. removeAllRecipients - removes all of the chosen recipients

  13. getChosenRecipients - returns all of the chosen recipients

IMPORTANT: you can only safely call the recipients' operations after the view got its size feagured out. You can use the function "runJustBeforeBeingDrawn" as I've written on some StackOverflow posts (like here), in case you need to use those operations as soon as possible.

In order to make it easy for you to find the code for those added features, I've put them all at the end of "RecipientEditTextView.java" file.

  1. Made the code a bit more readable. Not enough, but still... :)

Notes :