Merge "Scribe in View: disable cursor drag when handwriting is enabled" into tm-dev
This commit is contained in:
@@ -6309,7 +6309,8 @@ public class Editor {
|
||||
}
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (event.isFromSource(InputDevice.SOURCE_MOUSE)) {
|
||||
if (event.isFromSource(InputDevice.SOURCE_MOUSE)
|
||||
|| (mTextView.isAutoHandwritingEnabled() && isFromStylus(event))) {
|
||||
break;
|
||||
}
|
||||
if (mIsDraggingCursor) {
|
||||
@@ -6332,6 +6333,11 @@ public class Editor {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isFromStylus(MotionEvent motionEvent) {
|
||||
final int pointerIndex = motionEvent.getActionIndex();
|
||||
return motionEvent.getToolType(pointerIndex) == MotionEvent.TOOL_TYPE_STYLUS;
|
||||
}
|
||||
|
||||
private void positionCursorDuringDrag(MotionEvent event) {
|
||||
mPrevLineDuringDrag = getLineDuringDrag(event);
|
||||
int offset = mTextView.getOffsetAtCoordinate(mPrevLineDuringDrag, event.getX());
|
||||
|
||||
Reference in New Issue
Block a user