diff options
author | Ekin Oguz <ekinoguz@google.com> | 2017-02-01 00:12:28 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-02-01 00:12:28 +0000 |
commit | 0e11ec08352d4de1e2efe716c3b2fdf3f196eced (patch) | |
tree | cd2619929a5a77b8c1a6711c3a4f7868b2c124de /src/com | |
parent | 4b8be67300bc7e04905f81616332736901bfc1d1 (diff) | |
parent | 11c15260cb6878a67eb5d958277fce33e641720f (diff) | |
download | chips-0e11ec08352d4de1e2efe716c3b2fdf3f196eced.tar.gz |
Explicitly mark chips as "inReplacedChip".
am: 11c15260cb
Change-Id: I5d041093831616fc8cfb55e8d827fccc3e080c07
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/ex/chips/RecipientEditTextView.java | 1 | ||||
-rw-r--r-- | src/com/android/ex/chips/RecipientEntry.java | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java index 8e88895..9597aa1 100644 --- a/src/com/android/ex/chips/RecipientEditTextView.java +++ b/src/com/android/ex/chips/RecipientEditTextView.java @@ -2702,6 +2702,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements int end = getChipEnd(chip); getSpannable().removeSpan(chip); Editable editable = getText(); + entry.setInReplacedChip(true); CharSequence chipText = createChip(entry); if (chipText != null) { if (start == -1 || end == -1) { diff --git a/src/com/android/ex/chips/RecipientEntry.java b/src/com/android/ex/chips/RecipientEntry.java index a8c8c02..2669242 100644 --- a/src/com/android/ex/chips/RecipientEntry.java +++ b/src/com/android/ex/chips/RecipientEntry.java @@ -95,6 +95,9 @@ public class RecipientEntry { /** Should be used when type is {@link #ENTRY_TYPE_PERMISSION_REQUEST}. */ private final String[] mPermissions; + /** Whether RecipientEntry is in a replaced chip or not. */ + private boolean mInReplacedChip; + protected RecipientEntry(int entryType, String displayName, String destination, int destinationType, String destinationLabel, long contactId, Long directoryId, long dataId, Uri photoThumbnailUri, boolean isFirstLevel, boolean isValid, @@ -356,4 +359,19 @@ public class RecipientEntry { public void setIndicatorText(String indicatorText) { mIndicatorText = indicatorText; } + + /** + * Get whether this RecipientEntry is in a replaced chip or not. Replaced chip only occurs + * if {@link RecipientEditTextView} uses a replacement chip for the entry. + */ + public boolean getInReplacedChip() { + return mInReplacedChip; + } + + /** + * Sets {@link #mInReplacedChip} to {@param inReplacedChip}. + */ + public void setInReplacedChip(boolean inReplacedChip) { + mInReplacedChip = inReplacedChip; + } } |