Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 617202a5 authored by Mike LeBeau's avatar Mike LeBeau
Browse files

Fix a bug where clicking the "more results" suggestion with the trackball

did not seem to expand to show the corpus selectors. (http://b/1906643)

It turns out that when the trackball was used to select this item, onItemClick
was getting called on the listener twice in AutoCompleteTextView#onKeyUp:
once when we call onKeyUp on the DropDownListView, and once a little further
down when we call performCompletion(). In our case, performCompletion() is
useless since it was intended for normal AutoCompleteTextViews which populate
text into the TextView when an item in the list is clicked, but we do not
rely on this. So the easiest fix is just to make performCompletion() do nothing
in our SearchAutoComplete subclass.
parent 4bca97ec
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1572,6 +1572,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
        protected void replaceText(CharSequence text) {
        }
        
        /**
         * We override this method to avoid an extra onItemClick being called on the
         * drop-down's OnItemClickListener by {@link AutoCompleteTextView#onKeyUp(int, KeyEvent)}
         * when an item is clicked with the trackball.
         */
        @Override
        public void performCompletion() {
        }
        
        /**
         * We override this method so that we can allow a threshold of zero, which ACTV does not.
         */