If a chip is selected, hide the cursor.
This change got lost when I was removing the wrapper class.
Change-Id: I787f5cca6ba6d2226b383f07418e24ccbfbde122
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index a270f86..97e031a 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -339,6 +339,7 @@
mSelectedChip.unselectChip();
mSelectedChip = null;
}
+ setCursorVisible(true);
}
@Override
@@ -357,8 +358,10 @@
if (mSelectedChip != null && mSelectedChip != currentChip) {
clearSelectedChip();
mSelectedChip = currentChip.selectChip();
+ setCursorVisible(false);
} else if (mSelectedChip == null) {
mSelectedChip = currentChip.selectChip();
+ setCursorVisible(false);
} else {
mSelectedChip.onClick(this, offset, x, y);
}
@@ -575,9 +578,6 @@
Spannable spannable = getSpannable();
int spanStart = getChipStart();
int spanEnd = getChipEnd();
- if (this == mSelectedChip) {
- mSelectedChip = null;
- }
Editable text = getText();
int toDelete = spanEnd;
// Always remove trailing spaces when removing a chip.
@@ -589,6 +589,10 @@
mRecipients.remove(this);
spannable.setSpan(null, spanStart, spanEnd, 0);
text.delete(spanStart, toDelete);
+ if (this == mSelectedChip) {
+ mSelectedChip = null;
+ clearSelectedChip();
+ }
}
public int getChipStart() {