summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJin Cao <jinyan@google.com>2014-09-12 15:57:08 -0700
committerJin Cao <jinyan@google.com>2014-09-12 15:57:08 -0700
commitbd312313f352424415b103dd05d281f8ac47d547 (patch)
treebc5f1bd9c1c4da484404f20bbd93df86fa0e9e1e
parent14efc5795c38120de239fad3d44b1b8b81045043 (diff)
downloadandroid_frameworks_opt_chips-bd312313f352424415b103dd05d281f8ac47d547.tar.gz
android_frameworks_opt_chips-bd312313f352424415b103dd05d281f8ac47d547.tar.bz2
android_frameworks_opt_chips-bd312313f352424415b103dd05d281f8ac47d547.zip
Set dropdown height so dropdowns wont be on top
Always set the dropdown height to be the remaining space from the bottom of the edittext to the bottom of visible screen. This also greatly helps the illusion of "inlined" suggestions. b/17482147 Change-Id: I6124ff4c6c1646ef987d897059b3c024d002dfdc
-rw-r--r--src/com/android/ex/chips/RecipientEditTextView.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/ex/chips/RecipientEditTextView.java b/src/com/android/ex/chips/RecipientEditTextView.java
index 1629360..7a6ae7a 100644
--- a/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/src/com/android/ex/chips/RecipientEditTextView.java
@@ -505,6 +505,12 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
if (entries != null && entries.size() > 0) {
scrollBottomIntoView();
}
+ // Set the dropdown height to be the remaining height
+ final int[] coords = new int[2];
+ getLocationInWindow(coords);
+ final Rect displayFrame = new Rect();
+ getWindowVisibleDisplayFrame(displayFrame);
+ setDropDownHeight(displayFrame.bottom - coords[1] - getHeight());
}
});
baseAdapter.setDropdownChipLayouter(mDropdownChipLayouter);