move the cursor more if the user does big swipes
This commit is contained in:
parent
2702350471
commit
eeb12143b0
|
@ -1372,11 +1372,15 @@ class MyKeyboardView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||||
if (mIsLongPressingSpace) {
|
if (mIsLongPressingSpace) {
|
||||||
val diff = mLastX - mLastSpaceMoveX
|
val diff = mLastX - mLastSpaceMoveX
|
||||||
|
|
||||||
if (diff > SPACE_MOVE_THRESHOLD) {
|
if (diff < -SPACE_MOVE_THRESHOLD) {
|
||||||
onKeyboardActionListener?.moveCursorRight()
|
for (i in diff / SPACE_MOVE_THRESHOLD until 0) {
|
||||||
|
onKeyboardActionListener?.moveCursorLeft()
|
||||||
|
}
|
||||||
mLastSpaceMoveX = mLastX
|
mLastSpaceMoveX = mLastX
|
||||||
} else if (diff < -SPACE_MOVE_THRESHOLD) {
|
} else if (diff > SPACE_MOVE_THRESHOLD) {
|
||||||
onKeyboardActionListener?.moveCursorLeft()
|
for (i in 0 until diff / SPACE_MOVE_THRESHOLD) {
|
||||||
|
onKeyboardActionListener?.moveCursorRight()
|
||||||
|
}
|
||||||
mLastSpaceMoveX = mLastX
|
mLastSpaceMoveX = mLastX
|
||||||
}
|
}
|
||||||
} else if (!continueLongPress) {
|
} else if (!continueLongPress) {
|
||||||
|
|
Loading…
Reference in New Issue