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

Commit 61337c60 authored by Abaakouk Mehdi's avatar Abaakouk Mehdi
Browse files

Don't select text when searchDialog are triggered with a initial text

This fix CM issue 3300
Type a letter on a hard keyboard in browser, gtalk, ..., no longuer
select the first letter.

Change-Id: Ib1fe1a5097082becb9593ce5c347a5b6ac8fa4cb
parent 39a5fce9
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -239,6 +239,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
            // Display the drop down as soon as possible instead of waiting for the rest of the
            // pending UI stuff to get done, so that things appear faster to the user.
            mSearchAutoComplete.showDropDownAfterLayout();

            mSearchAutoComplete.post(new Runnable() {
                public void run() {
                    // Restore default value for selection on-focus when avery things are draw
                    mSearchAutoComplete.setSelectAllOnFocus(true);
                }
            });


        }
        return success;
    }
@@ -484,6 +493,10 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS

        mSearchAutoComplete.setForceIgnoreOutsideTouch(true);

        // Don't select text on first focus, because if user have hard keyboard, first letter will selected when UI are shown
        // we reenable it after all view are loaded
        mSearchAutoComplete.setSelectAllOnFocus(false);

        // attach the suggestions adapter, if suggestions are available
        // The existence of a suggestions authority is the proxy for "suggestions available here"
        if (mSearchable.getSuggestAuthority() != null) {