Skip to content

Trigger onSearchConfirmed when pressing the "ENTER" key (tablets with external keyboard) #37

Open

Description

@svrzii

Hello,

I'm having difficulties using the fork through jitpack.io (1.1.4 does not build successfully). I'm getting this: "⚠️ ERROR: No build artifacts found". https://jitpack.io/com/github/svrzii/persistent-search-view/v1.1.4/build.log

Is it possible to add this statement to the project, so on pressing ENTER, the listener would trigger correctly?

private final TextView.OnEditorActionListener mInternalEditorActionListener = new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
            if((actionId == EditorInfo.IME_ACTION_SEARCH) && (onSearchConfirmedListener != null)) {
                onSearchConfirmedListener.onSearchConfirmed(PersistentSearchView.this, getInputQuery());
            } else if (event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
                onSearchConfirmedListener.onSearchConfirmed(PersistentSearchView.this, getInputQuery());
            }

            return true;
        }
  };

svrzii@23cccd8

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions