Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
svrzii opened this issue Jul 19, 2022 · 0 comments

Comments

@svrzii
Copy link

svrzii commented Jul 19, 2022

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;
        }
  };

https://github.com/svrzii/persistent-search-view/commit/23cccd82d10ec9f2fee04884d9b455eeae8f5684

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant