summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJin Cao <jinyan@google.com>2014-08-08 13:26:14 -0700
committerJin Cao <jinyan@google.com>2014-08-08 13:26:14 -0700
commit9b166209d723ed996243de5d89b489f3992daf0e (patch)
tree737a0c363aa2c3f2fc696630e661ef28f61e8803
parentd36bf69b90b3441a3edff76ebd8c2adfeee4deab (diff)
downloadandroid_frameworks_opt_chips-9b166209d723ed996243de5d89b489f3992daf0e.tar.gz
android_frameworks_opt_chips-9b166209d723ed996243de5d89b489f3992daf0e.tar.bz2
android_frameworks_opt_chips-9b166209d723ed996243de5d89b489f3992daf0e.zip
More chip dropdown fix
Don't explicitly set chip popup width since the width should inherit from the anchor view. b/16851158 Change-Id: Id83d5dee1a2c44859e83d3862ada5f6e40b97065
-rw-r--r--src/com/android/ex/chips/RecipientEditTextView.java11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index a03e564..eab92bc 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -1701,7 +1701,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
}
private void showAlternates(final DrawableRecipientChip currentChip,
- final ListPopupWindow alternatesPopup, final int width) {
+ final ListPopupWindow alternatesPopup) {
new AsyncTask<Void, Void, ListAdapter>() {
@Override
protected ListAdapter doInBackground(final Void... params) {
@@ -1718,7 +1718,6 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
// Align the alternates popup with the left side of the View,
// regardless of the position of the chip tapped.
- alternatesPopup.setWidth(width);
alternatesPopup.setAnchorView((mAlternatePopupAnchor != null) ?
mAlternatePopupAnchor : RecipientEditTextView.this);
alternatesPopup.setVerticalOffset(bottomOffset);
@@ -2243,9 +2242,9 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
scrollLineIntoView(getLayout().getLineForOffset(getChipStart(newChip)));
}
if (showAddress) {
- showAddress(newChip, mAddressPopup, getWidth());
+ showAddress(newChip, mAddressPopup);
} else {
- showAlternates(newChip, mAlternatesPopup, getWidth());
+ showAlternates(newChip, mAlternatesPopup);
}
setCursorVisible(false);
return newChip;
@@ -2258,8 +2257,7 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
|| (!isPhoneQuery() && contactId == RecipientEntry.GENERATED_CONTACT);
}
- private void showAddress(final DrawableRecipientChip currentChip, final ListPopupWindow popup,
- int width) {
+ private void showAddress(final DrawableRecipientChip currentChip, final ListPopupWindow popup) {
if (!mAttachedToWindow) {
return;
}
@@ -2267,7 +2265,6 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
int bottomOffset = calculateOffsetFromBottomToTop(line);
// Align the alternates popup with the left side of the View,
// regardless of the position of the chip tapped.
- popup.setWidth(width);
popup.setAnchorView((mAlternatePopupAnchor != null) ? mAlternatePopupAnchor : this);
popup.setVerticalOffset(bottomOffset);
popup.setAdapter(createSingleAddressAdapter(currentChip));