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

Commit 09d66a38 authored by Daniel Lehmann's avatar Daniel Lehmann
Browse files

Restore Focus after rotation if we are searching

Bug:6027055
Change-Id: I3b9e23ab115c303ac2a68d8ddba55a35e2c4ed01
parent 92985dbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener {
        }
    }

    private void setFocusOnSearchView() {
    public void setFocusOnSearchView() {
        mSearchView.requestFocus();
        mSearchView.setIconified(false); // Workaround for the "IME not popping up" issue.
    }
+11 −0
Original line number Diff line number Diff line
@@ -1688,6 +1688,17 @@ public class PeopleActivity extends ContactsActivity
        }
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        // In our own lifecycle, the focus is saved and restore but later taken away by the
        // ViewPager. As a hack, we force focus on the SearchView if we know that we are searching.
        // This fixes the keyboard going away on screen rotation
        if (mActionBarAdapter.isSearchMode()) {
            mActionBarAdapter.setFocusOnSearchView();
        }
    }

    @Override
    public DialogManager getDialogManager() {
        return mDialogManager;