diff options
author | mindyp <mindyp@google.com> | 2012-09-24 13:48:46 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-24 13:48:46 -0700 |
commit | 65a0f02472df7c28f356822993142f6fff3eacc4 (patch) | |
tree | 73266427f89debfde091e453655d26fbd20ab65d /chips/src | |
parent | 88d18b9f331bcc39602fb4d883a88d9edd4ffa26 (diff) | |
parent | b6641931653e19766025820fb78c7142e597545e (diff) | |
download | android_frameworks_ex-65a0f02472df7c28f356822993142f6fff3eacc4.tar.gz android_frameworks_ex-65a0f02472df7c28f356822993142f6fff3eacc4.tar.bz2 android_frameworks_ex-65a0f02472df7c28f356822993142f6fff3eacc4.zip |
am b6641931: Make sure when we reverse lookup a recipient, we replace the underlying text string as well.
* commit 'b6641931653e19766025820fb78c7142e597545e':
Make sure when we reverse lookup a recipient, we replace the underlying text string as well.
Diffstat (limited to 'chips/src')
-rw-r--r-- | chips/src/com/android/ex/chips/RecipientEditTextView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java index 2486515..6914ad1 100644 --- a/chips/src/com/android/ex/chips/RecipientEditTextView.java +++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java @@ -2371,10 +2371,14 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements if (start != -1) { end = oldText.getSpanEnd(chip); oldText.removeSpan(chip); - // Leave a spot for the space! RecipientChip replacement = replacements.get(i); - text.setSpan(replacement, start, end, + // Trim any whitespace, as we will already have + // it added if these are replacement chips. + SpannableString displayText = new SpannableString( + createAddressText(replacement.getEntry()).trim()); + displayText.setSpan(replacement, 0, displayText.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + text.replace(start, end, displayText); replacement.setOriginalText(text.toString().substring(start, end)); } i++; |