Improve: Enable IME to show when executing apt commands

This commit is contained in:
zt515 2017-07-21 00:45:17 +08:00
parent bdc8f60da0
commit 668f877883

View File

@ -1,7 +1,9 @@
package io.neoterm.view package io.neoterm.view
import android.content.Context
import android.view.KeyEvent import android.view.KeyEvent
import android.view.MotionEvent import android.view.MotionEvent
import android.view.inputmethod.InputMethodManager
import io.neoterm.backend.TerminalSession import io.neoterm.backend.TerminalSession
/** /**
@ -20,6 +22,10 @@ class BasicViewClient(val terminalView: TerminalView) : TerminalViewClient {
} }
override fun onSingleTapUp(e: MotionEvent?) { override fun onSingleTapUp(e: MotionEvent?) {
if (terminalView.isFocusable && terminalView.isFocusableInTouchMode) {
(terminalView.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager)
.showSoftInput(terminalView, InputMethodManager.SHOW_IMPLICIT)
}
} }
override fun shouldBackButtonBeMappedToEscape(): Boolean { override fun shouldBackButtonBeMappedToEscape(): Boolean {