From a75fa12d54e386392adc0d4b54284a89ec191347 Mon Sep 17 00:00:00 2001 From: Kevin Lin Date: Mon, 3 Feb 2014 17:35:29 -0800 Subject: Fix chips library bugs related to setting the threshold to 1. - Dropdown not being dismissed after having at least one chip and typing a character and deleting it. - Selecting a chip, deleting it by pressing backspace, and entering another character brings the deleted chip back. TESTED=chips on bigtop app Change-Id: I09233ffa7dfe1f64ae9efe4a392fa84b64b8b10a --- chips/src/com/android/ex/chips/RecipientEditTextView.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'chips') diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java index c2d68d2..448de5a 100644 --- a/chips/src/com/android/ex/chips/RecipientEditTextView.java +++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java @@ -1431,9 +1431,11 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements Spannable span = getSpannable(); DrawableRecipientChip[] chips = span.getSpans(start, end, DrawableRecipientChip.class); if (chips != null && chips.length > 0) { + dismissDropDown(); return; } } else if (isCompletedToken) { + dismissDropDown(); return; } super.performFiltering(text, keyCode); @@ -2293,6 +2295,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements if (mMoreChip != null) { spannable.removeSpan(mMoreChip); } + clearSelectedChip(); return; } // Get whether there are any recipients pending addition to the -- cgit v1.2.3