| Chunk |
|---|
| Conflicting content |
|---|
<<<<<<< HEAD
if (hasInsertionController()) {
@Override
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getActionMasked();
getInsertionController().onTouchEvent(event);
}
if (hasSelectionController()) {
getSelectionController().onTouchEvent(event);
}
if (action == MotionEvent.ACTION_DOWN) {
mLastDownPositionX = (int) event.getX();
mLastDownPositionY = (int) event.getY();
=======
>>>>>>> e04c14962f4a1089d411e1f7fa4d1019fe723885
if (mInsertionPointCursorController != null) {
mInsertionPointCursorController.onTouchEvent(event); |
| Solution content |
|---|
@Override
public boolean onTouchEvent(MotionEvent event) {
final int action = event.getActionMasked();
if (hasInsertionController()) {
getInsertionController().onTouchEvent(event);
}
if (hasSelectionController()) {
getSelectionController().onTouchEvent(event);
}
if (action == MotionEvent.ACTION_DOWN) {
mLastDownPositionX = (int) event.getX();
mLastDownPositionY = (int) event.getY();
|
| File |
|---|
| TextView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Cast expression |
| If statement |
| Chunk |
|---|
| Conflicting content |
|---|
return superResult;
}
<<<<<<< HEAD
final boolean touchIsFinished = action == MotionEvent.ACTION_UP && !mIgnoreActionUpEvent &&
isFocused();
if ((mMovement != null || onCheckIsTextEditor()) && isEnabled()
&& mText instanceof Spannable && mLayout != null) {
=======
if ((mMovement != null || onCheckIsTextEditor()) && isEnabled() &&
mText instanceof Spannable && mLayout != null) {
>>>>>>> e04c14962f4a1089d411e1f7fa4d1019fe723885
boolean handled = false;
// Save previous selection, in case this event is used to show the IME. |
| Solution content |
|---|
return superResult;
}
final boolean touchIsFinished = action == MotionEvent.ACTION_UP && !mIgnoreActionUpEvent &&
isFocused();
if ((mMovement != null || onCheckIsTextEditor()) && isEnabled()
&& mText instanceof Spannable && mLayout != null) {
boolean handled = false;
// Save previous selection, in case this event is used to show the IME. |
| File |
|---|
| TextView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
@Override
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getActionMasked()) {
<<<<<<< HEAD
case MotionEvent.ACTION_DOWN: {
startTouchUpFilter(mController.getCurrentOffset(this));
mDownPositionX = ev.getRawX();
mDownPositionY = ev.getRawY();
mTouchToWindowOffsetX = mDownPositionX - mPositionX;
mTouchToWindowOffsetY = mDownPositionY - mPositionY;
final int[] coords = mTempCoords;
TextView.this.getLocationInWindow(coords);
mLastParentX = coords[0];
mLastParentY = coords[1];
mIsDragging = true;
if (mIsInsertionHandle) {
mTouchTimer = SystemClock.uptimeMillis();
}
break;
}
=======
case MotionEvent.ACTION_DOWN: {
final float rawX = ev.getRawX();
final float rawY = ev.getRawY();
mTouchToWindowOffsetX = rawX - mPositionX;
mTouchToWindowOffsetY = rawY - mPositionY;
final int[] coords = mTempCoords;
TextView.this.getLocationInWindow(coords);
mLastParentX = coords[0];
mLastParentY = coords[1];
mIsDragging = true;
break;
}
case MotionEvent.ACTION_MOVE: {
final float rawX = ev.getRawX();
final float rawY = ev.getRawY();
final float newPosX = rawX - mTouchToWindowOffsetX + mHotspotX;
final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY;
>>>>>>> e04c14962f4a1089d411e1f7fa4d1019fe723885
case MotionEvent.ACTION_MOVE: {
final float rawX = ev.getRawX(); |
| Solution content |
|---|
@Override
public boolean onTouchEvent(MotionEvent ev) {
switch (ev.getActionMasked()) {
case MotionEvent.ACTION_DOWN: {
startTouchUpFilter(mController.getCurrentOffset(this));
mDownPositionX = ev.getRawX();
mDownPositionY = ev.getRawY();
mTouchToWindowOffsetX = mDownPositionX - mPositionX;
mTouchToWindowOffsetY = mDownPositionY - mPositionY;
final int[] coords = mTempCoords;
TextView.this.getLocationInWindow(coords);
mLastParentX = coords[0];
mLastParentY = coords[1];
mIsDragging = true;
if (mIsInsertionHandle) {
mTouchTimer = SystemClock.uptimeMillis();
}
break;
}
case MotionEvent.ACTION_MOVE: {
final float rawX = ev.getRawX(); |
| File |
|---|
| TextView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Array access |
| Attribute |
| Break statement |
| Case statement |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
final float newPosX = rawX - mTouchToWindowOffsetX + mHotspotX;
final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY;
<<<<<<< HEAD
mController.updatePosition(this, Math.round(newPosX), Math.round(newPosY));
break;
}
case MotionEvent.ACTION_UP:
if (mIsInsertionHandle) {
long delay = SystemClock.uptimeMillis() - mTouchTimer;
if (delay < ViewConfiguration.getTapTimeout()) {
if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) {
// Tapping on the handle dismisses the displayed paste view,
mPastePopupWindow.hide();
} else {
((InsertionPointCursorController) mController).show(0);
}
}
}
filterOnTouchUp();
mIsDragging = false;
break;
case MotionEvent.ACTION_CANCEL:
mIsDragging = false;
break;
=======
break;
}
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
mIsDragging = false;
>>>>>>> e04c14962f4a1089d411e1f7fa4d1019fe723885
}
return true;
} |
| Solution content |
|---|
final float newPosX = rawX - mTouchToWindowOffsetX + mHotspotX;
final float newPosY = rawY - mTouchToWindowOffsetY + mHotspotY + mTouchOffsetY;
mController.updatePosition(this, Math.round(newPosX), Math.round(newPosY));
break;
}
case MotionEvent.ACTION_UP:
if (mIsInsertionHandle) {
long delay = SystemClock.uptimeMillis() - mTouchTimer;
if (delay < ViewConfiguration.getTapTimeout()) {
if (mPastePopupWindow != null && mPastePopupWindow.isShowing()) {
// Tapping on the handle dismisses the displayed paste view,
mPastePopupWindow.hide();
} else {
((InsertionPointCursorController) mController).show(0);
}
}
}
filterOnTouchUp();
mIsDragging = false;
break;
case MotionEvent.ACTION_CANCEL:
mIsDragging = false;
break;
}
return true;
} |
| File |
|---|
| TextView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Break statement |
| Case statement |
| If statement |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
// Double tap detection
long duration = SystemClock.uptimeMillis() - mPreviousTapUpTime;
<<<<<<< HEAD
if (duration <= ViewConfiguration.getDoubleTapTimeout() &&
isPositionOnText(x, y)) {
final int deltaX = x - mPreviousTapPositionX;
final int deltaY = y - mPreviousTapPositionY;
final int distanceSquared = deltaX * deltaX + deltaY * deltaY;
if (distanceSquared < mSquaredTouchSlopDistance) {
startSelectionActionMode();
mDiscardNextActionUp = true;
}
}
=======
if (duration <= ViewConfiguration.getDoubleTapTimeout()) {
final int deltaX = x - mPreviousTapPositionX;
final int deltaY = y - mPreviousTapPositionY;
final int distanceSquared = deltaX * deltaX + deltaY * deltaY;
final int doubleTapSlop = ViewConfiguration.get(getContext()).getScaledDoubleTapSlop();
final int slopSquared = doubleTapSlop * doubleTapSlop;
if (distanceSquared < slopSquared) {
startTextSelectionMode();
// Hacky: onTapUpEvent will open a context menu with cut/copy
// Prevent this by hiding handles which will be revived instead.
hide();
}
}
>>>>>>> e04c14962f4a1089d411e1f7fa4d1019fe723885
mPreviousTapPositionX = x;
mPreviousTapPositionY = y;
|
| Solution content |
|---|
// Double tap detection
long duration = SystemClock.uptimeMillis() - mPreviousTapUpTime;
if (duration <= ViewConfiguration.getDoubleTapTimeout() &&
isPositionOnText(x, y)) {
final int deltaX = x - mPreviousTapPositionX;
final int deltaY = y - mPreviousTapPositionY;
final int distanceSquared = deltaX * deltaX + deltaY * deltaY;
if (distanceSquared < mSquaredTouchSlopDistance) {
startSelectionActionMode();
mDiscardNextActionUp = true;
}
}
mPreviousTapPositionX = x;
mPreviousTapPositionY = y;
|
| File |
|---|
| TextView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| If statement |