Skip to content

Instantly share code, notes, and snippets.

@suzp1984
Last active December 14, 2019 00:49
Show Gist options
  • Save suzp1984/d16d1e6933cbbfb957d6bfb38b6cfaab to your computer and use it in GitHub Desktop.
Save suzp1984/d16d1e6933cbbfb957d6bfb38b6cfaab to your computer and use it in GitHub Desktop.
wire up the unfocusable EditText with CustomInputView & InputDelegateView
// editText -> unfocusable EditText
// customeKeyboardView -> simulated keyboard
// inputDelegateView -> Delegate system keyboard input to EditText
func wireUpConnections() {
val inputConnection = editText.onCreateInputConnection(EditorInfo())
customeKeyboardView.inputConnection = inputConnection
val keyboardInputConnection = editText.onCreateInputConnection(EditorInfo())
inputDelegateView.delegateConnection = keyboardInputConnection
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment