summaryrefslogtreecommitdiffstats
path: root/chips/src
diff options
context:
space:
mode:
authormindyp <mindyp@google.com>2012-10-03 11:57:42 -0700
committermindyp <mindyp@google.com>2012-10-03 12:00:15 -0700
commit17c922958f2a9bad8b22675e7daf9b40bf6ef2ce (patch)
tree1e06377e4b978e675b05cb3cbb709d0416c37202 /chips/src
parentafca3691912c1986f4ef2dae3c2187340c1c19c1 (diff)
downloadandroid_frameworks_ex-17c922958f2a9bad8b22675e7daf9b40bf6ef2ce.tar.gz
android_frameworks_ex-17c922958f2a9bad8b22675e7daf9b40bf6ef2ce.tar.bz2
android_frameworks_ex-17c922958f2a9bad8b22675e7daf9b40bf6ef2ce.zip
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 eac398a..dc73933 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -2023,8 +2023,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) == ' ') {
@@ -2236,7 +2235,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) {
@@ -2388,8 +2388,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