- show soft keyboard automatically when new message gets focus

This commit is contained in:
Juha Heinanen
2019-03-18 06:56:47 +13:00
parent 86f44a33e8
commit 10f7db4248

View File

@ -114,6 +114,12 @@ class ChatActivity : AppCompatActivity() {
}
newMessage = findViewById(R.id.text) as EditText
newMessage.setOnFocusChangeListener(View.OnFocusChangeListener { v, hasFocus ->
if (hasFocus) {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
}
})
if (focus) newMessage.requestFocus()
sendButton = findViewById(R.id.sendButton) as ImageButton