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

How to hide keyboard if press enter in keyboard ? or disable enter in keyboard ? #192

Open
afdaldev opened this issue May 4, 2020 · 0 comments

Comments

@afdaldev
Copy link

afdaldev commented May 4, 2020

i've try but don't work

chatView.setOnKeyListener { v, keyCode, event -> if (keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_DOWN) { Toast.makeText(this, "Enter", Toast.LENGTH_LONG).show() if (v != null) { val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager imm.hideSoftInputFromWindow(v.windowToken, 0) } window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN) return@setOnKeyListener true } return@setOnKeyListener false }

or how to max input line 1 ?
i've try chatView.setMaxInputLine(1) but don't work

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