Do not resize autocomplete dialog when showing permission entry.
Change-Id: Id764b7a0fc61536b1527c94013beebc3e4a004db
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index 3565c00..162acb0 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -547,11 +547,19 @@
}
}
- // Set the dropdown height to be the remaining height from the anchor to the bottom.
- mDropdownAnchor.getLocationInWindow(mCoords);
- getWindowVisibleDisplayFrame(mRect);
- setDropDownHeight(mRect.bottom - mCoords[1] - mDropdownAnchor.getHeight() -
- getDropDownVerticalOffset());
+ if ((entries != null)
+ && (entries.size() == 1)
+ && (entries.get(0).getEntryType() ==
+ RecipientEntry.ENTRY_TYPE_PERMISSION_REQUEST)) {
+ // Do nothing; showing a single permissions entry. Resizing not required.
+ } else {
+ // Set the dropdown height to be the remaining height from the anchor to the
+ // bottom.
+ mDropdownAnchor.getLocationInWindow(mCoords);
+ getWindowVisibleDisplayFrame(mRect);
+ setDropDownHeight(mRect.bottom - mCoords[1] - mDropdownAnchor.getHeight() -
+ getDropDownVerticalOffset());
+ }
mCurrentSuggestionCount = entries == null ? 0 : entries.size();
}