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

Further input improvements

parent 6ec2a129
Branches
No related tags found
No related merge requests found
......@@ -125,23 +125,6 @@ class Editor(
send()
}
chatline.setOnKeyListener { _, keyCode, event ->
when (keyCode) {
KeyEvent.KEYCODE_ENTER,
KeyEvent.KEYCODE_NUMPAD_ENTER -> if (event.hasNoModifiers()) {
send()
true
} else {
false
}
KeyEvent.KEYCODE_TAB -> {
autoComplete(event.isShiftPressed)
true
}
else -> false
}
}
chatline.imeOptions = when (appearanceSettings.inputEnter) {
AppearanceSettings.InputEnterMode.EMOJI -> listOf(
EditorInfo.IME_ACTION_NONE,
......@@ -286,7 +269,20 @@ class Editor(
true
}
else -> false
} else false
} else when (keyCode) {
KeyEvent.KEYCODE_ENTER,
KeyEvent.KEYCODE_NUMPAD_ENTER -> if (event.isShiftPressed) {
false
} else {
send()
true
}
KeyEvent.KEYCODE_TAB -> {
autoComplete(event.isShiftPressed)
true
}
else -> false
}
}
}
......
......@@ -187,10 +187,16 @@ class IrcFormatSerializer @Inject constructor(private val context: Context) {
} else {
writeColor(afterForegroundCode, afterBackgroundCode)
}
} else if (afterForeground != null || afterBackground != null) {
writeHexColor(afterForeground, afterBackground)
} else {
if (foregroundCode != null || backgroundCode != null) {
writeColor(afterForeground, afterBackground)
} else {
writeHexColor(afterForeground, afterBackground)
}
}
}
out.append(text.subSequence(i, next))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment