| Chunk |
|---|
| Conflicting content |
|---|
private static final int INVALID_POINTER = -1;
/**
<<<<<<< HEAD
=======
* Maximum distance to overscroll by during edge effects
*/
int mOverscrollDistance;
/**
* Maximum distance to overfling during edge effects
*/
int mOverflingDistance;
// These two EdgeGlows are always set and used together.
// Checking one for null is as good as checking both.
/**
* Tracks the state of the top edge glow.
*/
private EdgeGlow mEdgeGlowTop;
/**
* Tracks the state of the bottom edge glow.
*/
private EdgeGlow mEdgeGlowBottom;
/**
* An estimate of how many pixels are between the top of the list and
* the top of the first position in the adapter, based on the last time
* we saw it. Used to hint where to draw edge glows.
*/
private int mFirstPositionDistanceGuess;
/**
* An estimate of how many pixels are between the bottom of the list and
* the bottom of the last position in the adapter, based on the last time
* we saw it. Used to hint where to draw edge glows.
*/
private int mLastPositionDistanceGuess;
/**
* Used for determining when to cancel out of overscroll.
*/
private int mDirection = 0;
/**
>>>>>>> 53fb09b42f8862650f959c30c1ab104142fa873a
* Interface definition for a callback to be invoked when the list or grid
* has been scrolled.
*/ |
| Solution content |
|---|
private static final int INVALID_POINTER = -1;
/**
* Interface definition for a callback to be invoked when the list or grid
* has been scrolled.
*/ |
| File |
|---|
| AbsListView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| Chunk |
|---|
| Conflicting content |
|---|
}
// Check to see if we have bumped into the scroll limit
<<<<<<< HEAD
if (atEdge && getChildCount() > 0) {
// Treat this like we're starting a new scroll from the current
// position. This will let the user start scrolling back into
// content immediately rather than needing to scroll back to the
// point where they hit the limit first.
int motionPosition = findMotionRow(y);
if (motionPosition >= 0) {
final View motionView = getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop = motionView.getTop();
=======
motionView = this.getChildAt(motionIndex);
if (motionView != null) {
// Check if the top of the motion view is where it is
// supposed to be
final int motionViewRealTop = motionView.getTop();
if (atEdge) {
// Apply overscroll
int overscroll = -incrementalDeltaY -
(motionViewRealTop - motionViewPrevTop);
overscrollBy(0, overscroll, 0, mScrollY, 0, 0,
0, mOverscrollDistance, true);
if (Math.abs(mOverscrollDistance) == Math.abs(mScrollY)) {
// Don't allow overfling if we're at the edge.
mVelocityTracker.clear();
}
final int overscrollMode = getOverscrollMode();
if (overscrollMode == OVERSCROLL_ALWAYS ||
(overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS &&
!contentFits())) {
mDirection = 0; // Reset when entering overscroll.
mTouchMode = TOUCH_MODE_OVERSCROLL;
if (rawDeltaY > 0) {
mEdgeGlowTop.onPull((float) overscroll / getHeight());
} else if (rawDeltaY < 0) {
mEdgeGlowBottom.onPull((float) overscroll / getHeight());
}
}
>>>>>>> 53fb09b42f8862650f959c30c1ab104142fa873a
}
mMotionY = y;
mMotionPosition = motionPosition; |
| Solution content |
|---|
}
// Check to see if we have bumped into the scroll limit
if (atEdge && getChildCount() > 0) {
// Treat this like we're starting a new scroll from the current
// position. This will let the user start scrolling back into
// content immediately rather than needing to scroll back to the
// point where they hit the limit first.
int motionPosition = findMotionRow(y);
if (motionPosition >= 0) {
final View motionView = getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop = motionView.getTop();
}
mMotionY = y;
mMotionPosition = motionPosition; |
| File |
|---|
| AbsListView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| If statement |
| Method invocation |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
mLastY = y;
}
break;
<<<<<<< HEAD
=======
case TOUCH_MODE_OVERSCROLL:
if (y != mLastY) {
final int rawDeltaY = deltaY;
deltaY -= mMotionCorrection;
int incrementalDeltaY = mLastY != Integer.MIN_VALUE ? y - mLastY : deltaY;
final int oldScroll = mScrollY;
final int newScroll = oldScroll - incrementalDeltaY;
int newDirection = y > mLastY ? 1 : -1;
if (mDirection == 0) {
mDirection = newDirection;
}
if (mDirection != newDirection) {
// Coming back to 'real' list scrolling
incrementalDeltaY = -newScroll;
mScrollY = 0;
// No need to do all this work if we're not going to move anyway
if (incrementalDeltaY != 0) {
trackMotionScroll(incrementalDeltaY, incrementalDeltaY);
}
// Check to see if we are back in
View motionView = this.getChildAt(mMotionPosition - mFirstPosition);
if (motionView != null) {
mTouchMode = TOUCH_MODE_SCROLL;
// We did not scroll the full amount. Treat this essentially like the
// start of a new touch scroll
final int motionPosition = findClosestMotionRow(y);
mMotionCorrection = 0;
motionView = getChildAt(motionPosition - mFirstPosition);
mMotionViewOriginalTop = motionView.getTop();
mMotionY = y;
mMotionPosition = motionPosition;
}
} else {
overscrollBy(0, -incrementalDeltaY, 0, mScrollY, 0, 0,
0, mOverscrollDistance, true);
final int overscrollMode = getOverscrollMode();
if (overscrollMode == OVERSCROLL_ALWAYS ||
(overscrollMode == OVERSCROLL_IF_CONTENT_SCROLLS &&
!contentFits())) {
if (rawDeltaY > 0) {
mEdgeGlowTop.onPull((float) -incrementalDeltaY / getHeight());
} else if (rawDeltaY < 0) {
mEdgeGlowBottom.onPull((float) -incrementalDeltaY / getHeight());
}
invalidate();
}
if (Math.abs(mOverscrollDistance) == Math.abs(mScrollY)) {
// Don't allow overfling if we're at the edge.
mVelocityTracker.clear();
}
}
mLastY = y;
mDirection = newDirection;
}
break;
>>>>>>> 53fb09b42f8862650f959c30c1ab104142fa873a
}
break; |
| Solution content |
|---|
mLastY = y;
}
break;
}
break; |
| File |
|---|
| AbsListView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Break statement |
| Case statement |
| If statement |