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

Commit 280c753a authored by Evan Millar's avatar Evan Millar
Browse files

Modify text validation behavior.

-Only perform validation when the view is *losing* focus.
-Don't perform validation when the window focus changes. This causes odd
behavior like validation being peformed when menu is pressed, or long
press dialogs pop-up.
parent 48956ad3
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1027,7 +1027,6 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
    @Override
    public void onWindowFocusChanged(boolean hasWindowFocus) {
        super.onWindowFocusChanged(hasWindowFocus);
        performValidation();
        if (!hasWindowFocus && !mDropDownAlwaysVisible) {
            dismissDropDown();
        }
@@ -1036,7 +1035,10 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
    @Override
    protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
        super.onFocusChanged(focused, direction, previouslyFocusedRect);
        // Perform validation if the view is losing focus.
        if (!focused) {
            performValidation();
        }
        if (!focused && !mDropDownAlwaysVisible) {
            dismissDropDown();
        }