summaryrefslogtreecommitdiffstats
path: root/chips/src
diff options
context:
space:
mode:
authormindyp <mindyp@google.com>2012-10-03 11:57:42 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-03 13:34:43 -0700
commitc16fb2a3bcc168fb69a92f43aebf6cfa4bf3a007 (patch)
treed15b1a0cab65bdc24e2912812704c2fabeabbd15 /chips/src
parent0c6fe7e60e7550e56ad1982d0d5833b64eea6f97 (diff)
downloadandroid_frameworks_ex-c16fb2a3bcc168fb69a92f43aebf6cfa4bf3a007.tar.gz
android_frameworks_ex-c16fb2a3bcc168fb69a92f43aebf6cfa4bf3a007.tar.bz2
android_frameworks_ex-c16fb2a3bcc168fb69a92f43aebf6cfa4bf3a007.zip
cherrypick: Make sure we check the most up to date text for the token offsets.
The issue here was that we were using the old version of the editable string (cached in var text) to look for the start/end of tokens, but the result of calling commitChip may have updated the text (added corrective rfc822 formatting, or a display name) Fixes b/7268603 [Manta] List of email addresses pasted into the To field is broken Change-Id: Iccc8dbf78a018c84fd818582d10ff2b02a787276
Diffstat (limited to 'chips/src')
-rw-r--r--chips/src/com/android/ex/chips/RecipientEditTextView.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java
index a604807..ec95e47 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -2049,8 +2049,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
} else {
if (!TextUtils.isEmpty(chipText)) {
// There may be a space to replace with this chip's new
- // associated
- // space. Check for it
+ // associated space. Check for it
int toReplace = end;
while (toReplace >= 0 && toReplace < editable.length()
&& editable.charAt(toReplace) == ' ') {
@@ -2263,7 +2262,8 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
int tokenEnd;
RecipientChip createdChip;
while (tokenStart < originalTokenStart) {
- tokenEnd = movePastTerminators(mTokenizer.findTokenEnd(text, tokenStart));
+ tokenEnd = movePastTerminators(mTokenizer.findTokenEnd(getText().toString(),
+ tokenStart));
commitChip(tokenStart, tokenEnd, getText());
createdChip = findChip(tokenStart);
if (createdChip == null) {
@@ -2415,8 +2415,8 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
if (RecipientEntry.isCreatedRecipient(temp.getEntry().getContactId())
&& getSpannable().getSpanStart(temp) != -1) {
// Replace this.
- final RecipientEntry entry = createValidatedEntry(entries
- .get(tokenizeAddress(temp.getEntry().getDestination()).toLowerCase()));
+ final RecipientEntry entry = createValidatedEntry(entries.get(tokenizeAddress(
+ temp.getEntry().getDestination()).toLowerCase()));
if (entry != null) {
mHandler.post(new Runnable() {
@Override