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

Commit 71c3d1f0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Handle enter key as editor action in search bar" into main

parents 7f50e9c6 32ef2aed
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -118,8 +118,14 @@ public class AllAppsSearchBarController
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

        if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_GO) {
        if (actionId == EditorInfo.IME_ACTION_SEARCH || actionId == EditorInfo.IME_ACTION_GO || (
                actionId == EditorInfo.IME_NULL && event != null
                        && event.getAction() == KeyEvent.ACTION_DOWN)) {
            if (actionId == EditorInfo.IME_NULL) {
                Log.i(TAG, "User pressed ENTER key");
            } else {
                Log.i(TAG, "User tapped ime search button");
            }
            // selectFocusedView should return SearchTargetEvent that is passed onto onClick
            return mLauncher.getAppsView().getMainAdapterProvider().launchHighlightedItem();
        }