Skip to content

Commit a0383f7

Browse files
Gilles DebunneAndroid (Google) Code Review
authored andcommitted
Merge "Bug 5319091: Completions delayed in AutoComplete in landscape"
2 parents 2e4a560 + d513e97 commit a0383f7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

core/java/android/widget/AutoCompleteTextView.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,6 @@ void doAfterTextChanged() {
744744
if (mFilter != null) {
745745
mPopupCanBeUpdated = true;
746746
performFiltering(getText(), mLastKeyCode);
747-
buildImeCompletions();
748747
}
749748
} else {
750749
// drop down is automatically dismissed when enough characters
@@ -934,7 +933,8 @@ private void updateDropDownForFilter(int count) {
934933
*/
935934

936935
final boolean dropDownAlwaysVisible = mPopup.isDropDownAlwaysVisible();
937-
if ((count > 0 || dropDownAlwaysVisible) && enoughToFilter()) {
936+
final boolean enoughToFilter = enoughToFilter();
937+
if ((count > 0 || dropDownAlwaysVisible) && enoughToFilter) {
938938
if (hasFocus() && hasWindowFocus() && mPopupCanBeUpdated) {
939939
showDropDown();
940940
}
@@ -1045,6 +1045,8 @@ public boolean isInputMethodNotNeeded() {
10451045
* <p>Displays the drop down on screen.</p>
10461046
*/
10471047
public void showDropDown() {
1048+
buildImeCompletions();
1049+
10481050
if (mPopup.getAnchorView() == null) {
10491051
if (mDropDownAnchorId != View.NO_ID) {
10501052
mPopup.setAnchorView(getRootView().findViewById(mDropDownAnchorId));
@@ -1060,7 +1062,7 @@ public void showDropDown() {
10601062
mPopup.show();
10611063
mPopup.getListView().setOverScrollMode(View.OVER_SCROLL_ALWAYS);
10621064
}
1063-
1065+
10641066
/**
10651067
* Forces outside touches to be ignored. Normally if {@link #isDropDownAlwaysVisible()} is
10661068
* false, we allow outside touch to dismiss the dropdown. If this is set to true, then we
@@ -1071,7 +1073,7 @@ public void showDropDown() {
10711073
public void setForceIgnoreOutsideTouch(boolean forceIgnoreOutsideTouch) {
10721074
mPopup.setForceIgnoreOutsideTouch(forceIgnoreOutsideTouch);
10731075
}
1074-
1076+
10751077
private void buildImeCompletions() {
10761078
final ListAdapter adapter = mAdapter;
10771079
if (adapter != null) {
@@ -1086,8 +1088,7 @@ private void buildImeCompletions() {
10861088
realCount++;
10871089
Object item = adapter.getItem(i);
10881090
long id = adapter.getItemId(i);
1089-
completions[i] = new CompletionInfo(id, i,
1090-
convertSelectionToString(item));
1091+
completions[i] = new CompletionInfo(id, i, convertSelectionToString(item));
10911092
}
10921093
}
10931094

0 commit comments

Comments
 (0)