MaterialChipsInput
MaterialChipsInput copied to clipboard
hide the filterable list + request focus to open keyboard
For the most part of it, this library is great. However, I've been pulling my hair over simple issues.
- How do I hide the filterable list manually? Once it's open, there's no way to close it other than clicking an item. I've tried
-
mChipsInput.setFilterableList(new ArrayList<ChipInterface>());
-
mChipsInput.getEditText().getFilterableListView().fadeOut();
-
mChipsInput.getEditText().getFilterableListView().fadeOut();
-
mChipsInput.getFilterableList().clear()
, and calledmChipsInput.invalidate()
afterwards
The view logic is just so poorly designed, none of these seem to work. I've been digging into the source code and see that fadeOut()
is to hide it from within the library. Why doesn't it work when used as an api?
-
Open the soft-keyboard automatically when the
mChipsInput
is clicked. I've tried the following:mChipsInput.requestFocus(); mChipsInput.getEditText().requestFocus(); openKeyboard(mChipsInput.getEditText()); // this uses the InputManager to open the keyboard on this view. mChipsInput.getEditText().performClick();
Again, none of these work!
Turns out it was a really silly line in the code that was causing the issue as for 1. I've sent a PR #99
It creates the edittext only once, instead of creating a new one each time getEditText
is called.