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

Commit afd3fbeb authored by Daniel Lehmann's avatar Daniel Lehmann Committed by Android (Google) Code Review
Browse files

Merge "Restore Focus after rotation if we are searching"

parents 170dcb04 09d66a38
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;