Fix remaining keyboard weirdness

- In some cases, pressing backspace would remove more than one character
- Double tap to add period wouldn't keep a space after the period
This commit is contained in:
Moez Bhatti
2018-05-07 13:13:24 -04:00
parent 1da46c2961
commit dc4663ee14
@@ -198,8 +198,7 @@ class QkEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet
override fun deleteSurroundingText(beforeLength: Int, afterLength: Int): Boolean {
if (beforeLength == 1 && afterLength == 0) {
sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL))
&& sendKeyEvent(KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_DEL))
backspaces.onNext(Unit)
}
return super.deleteSurroundingText(beforeLength, afterLength)
}