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

Commit b0d82d27 authored by Daniel Lehmann's avatar Daniel Lehmann
Browse files

Fix for "Next" instead of Search showing up the first time

Bug: 6399620
Change-Id: I8d6d7f4e75a18745d7127edde9ae3326220d4fcb
parent 4f135ab1
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -290,12 +290,15 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener {
    }
    }


    private void update() {
    private void update() {
        boolean isIconifiedChanging = mSearchView.isIconified() == mSearchMode;
        if (mSearchMode) {
        if (mSearchMode) {
            setFocusOnSearchView();
            setFocusOnSearchView();
            // Since we have the {@link SearchView} in a custom action bar, we must manually handle
            // Since we have the {@link SearchView} in a custom action bar, we must manually handle
            // expanding the {@link SearchView} when a search is initiated. Note that a side effect
            // expanding the {@link SearchView} when a search is initiated. Note that a side effect
            // of this method is that the {@link SearchView} query text is set to empty string.
            // of this method is that the {@link SearchView} query text is set to empty string.
            if (isIconifiedChanging) {
                mSearchView.onActionViewExpanded();
                mSearchView.onActionViewExpanded();
            }
            if (mActionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) {
            if (mActionBar.getNavigationMode() != ActionBar.NAVIGATION_MODE_STANDARD) {
                mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
                mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
            }
            }
@@ -320,7 +323,9 @@ public class ActionBarAdapter implements OnQueryTextListener, OnCloseListener {
            mActionBar.setTitle(null);
            mActionBar.setTitle(null);
            // Since we have the {@link SearchView} in a custom action bar, we must manually handle
            // Since we have the {@link SearchView} in a custom action bar, we must manually handle
            // collapsing the {@link SearchView} when search mode is exited.
            // collapsing the {@link SearchView} when search mode is exited.
            if (isIconifiedChanging) {
                mSearchView.onActionViewCollapsed();
                mSearchView.onActionViewCollapsed();
            }
            if (mListener != null) {
            if (mListener != null) {
                mListener.onAction(Action.STOP_SEARCH_MODE);
                mListener.onAction(Action.STOP_SEARCH_MODE);
                mListener.onSelectedTabChanged();
                mListener.onSelectedTabChanged();