Reputation: 2276
I have searched everywhere to find the Chips View library that I need.
The Chips need to be displayed inside an EditText with Autocomplete function. I have tried https://github.com/klinker41/android-chips and https://github.com/DoodleScheduling/android-material-chips but they think I will be using there library for Contacts (or email addresses). That is not the case, I'll be using them for Tags (with 1 word and 1 icon). I have tried to make my own version of both of the libraries, but they are way to complicated.
Does anybody know a good Chips View library that has the same functionality and looks the same?
Upvotes: 6
Views: 1906
Reputation: 1325
I was able to implement material chips using this library: https://github.com/splitwise/TokenAutoComplete.
It works with custom data (you have to implement your own view) and is very extensible.
public class ContactsCompletionView extends TokenCompleteTextView<Person> {
...
@Override
protected View getViewForObject(Person person) {
LayoutInflater l = (LayoutInflater) getContext().getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
TokenTextView token = (TokenTextView) l.inflate(R.layout.contact_token, (ViewGroup) getParent(), false);
token.setText(person.getEmail());
return token;
}
}
Upvotes: 0