Skip to content
Snippets Groups Projects
Commit 3c59f572 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Minor fix for broken android versions

parent d215c145
No related branches found
No related tags found
No related merge requests found
......@@ -334,21 +334,19 @@ class Editor(
}
TooltipCompat.setTooltipText(clearButton, clearButton.contentDescription)
chatline.setOnEditorActionListener { _, actionId, event ->
if (event.action == KeyEvent.ACTION_DOWN) {
chatline.setOnEditorActionListener { _, actionId, event: KeyEvent? ->
when (actionId) {
EditorInfo.IME_ACTION_SEND,
EditorInfo.IME_ACTION_DONE -> {
send()
if (event?.action == KeyEvent.ACTION_DOWN) send()
true
}
else -> false
}
} else false
}
chatline.setOnKeyListener { _, keyCode, event ->
if (event.action == KeyEvent.ACTION_DOWN) {
chatline.setOnKeyListener { _, keyCode, event: KeyEvent? ->
if (event?.action == KeyEvent.ACTION_DOWN) {
if (event.isCtrlPressed && !event.isAltPressed) when (keyCode) {
KeyEvent.KEYCODE_B -> {
formatHandler.toggleBold(chatline.selection)
......@@ -385,7 +383,7 @@ class Editor(
else -> false
}
} else if (keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER) {
!event.isShiftPressed
!(event?.isShiftPressed ?: false)
} else {
false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment