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

Hide soft keyboard when a button is pressed #3

Open
voghDev opened this issue Mar 20, 2018 · 0 comments
Open

Hide soft keyboard when a button is pressed #3

voghDev opened this issue Mar 20, 2018 · 0 comments

Comments

@voghDev
Copy link
Owner

voghDev commented Mar 20, 2018

Implement a test that could be like "should hide soft keyboard when search button is pressed"

It would be desirable to bring it to perfect red, then green, for every screen

Use this extension function

fun Context.hideSoftKeyboard(v: View) {
    val imm: InputMethodManager? = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
    imm?.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS)
}
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