Last active
March 26, 2020 15:25
-
-
Save GluTbl/20643424c99398b55eb24a67abe13b3e to your computer and use it in GitHub Desktop.
[Hide focus in edit text] #Kotlin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun hidefocus(v:View?) { | |
try { | |
val imm =getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager | |
if (v != null) { | |
imm.hideSoftInputFromWindow(v.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS) | |
} | |
} catch (ignored: Exception) { | |
} | |
edit_port.setSelected(false) | |
edit_port.setFocusable(false) | |
edit_port.setFocusableInTouchMode(true) | |
edit_password.setSelected(false) | |
edit_password.setFocusable(false) | |
edit_password.setFocusableInTouchMode(true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment