Skip to content

Commit 5f632ef

Browse files
committed
Upload file
1 parent aeb3005 commit 5f632ef

4 files changed

Lines changed: 47 additions & 1130 deletions

File tree

common/src/main/java/com/omarea/overscroll/OverScrollDelegate.java

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -522,26 +522,23 @@ private boolean onTouchEventInternal(MotionEvent event) {
522522
}
523523
break;
524524
}
525-
case MotionEvent.ACTION_UP:
526-
case MotionEvent.ACTION_CANCEL: {
527-
528-
if (mOffsetY != 0f) {
529-
530-
if (isOsTop()) {
531-
// 🔼 KÉO LÊN → GIỮ NGUYÊN, KHÔNG AUTO CUỘN
532-
setState(OS_NONE);
533-
// giữ mOffsetY, không spring
534-
} else if (isOsBottom()) {
535-
// 🔽 KÉO XUỐNG ĐÁY → VẪN SPRING BACK
536-
final int startScrollY = Math.round(mOffsetY);
537-
mScroller.start(startScrollY, DRAG_BACK_DURATION, sDragBackPathPointsHolder);
538-
setState(OS_SPRING_BACK);
539-
}
540-
mView.invalidate();
541-
}
542-
543-
mActivePointerId = INVALID_POINTER;
544-
}
525+
case MotionEvent.ACTION_UP:
526+
case MotionEvent.ACTION_CANCEL: {
527+
if (mOffsetY != 0f) {
528+
// Sping back to 0
529+
final int startScrollY = Math.round(mOffsetY);
530+
// mScroller.startScroll(0, startScrollY, 0, -startScrollY,
531+
// SPRING_BACK_DURATION);
532+
// mPath.reset();
533+
// mPath.moveTo(0f, startScrollY);
534+
// mPath.lineTo(1f, 0);
535+
// mScroller.start(1f, SPRING_BACK_DURATION, mPath);
536+
mScroller.start(startScrollY, DRAG_BACK_DURATION, sDragBackPathPointsHolder);
537+
setState(OS_SPRING_BACK);
538+
mView.invalidate();
539+
}
540+
mActivePointerId = INVALID_POINTER;
541+
}
545542
}
546543
return isOsDrag();
547544
}

0 commit comments

Comments
 (0)