Skip to content

Commit 001906c

Browse files
committed
Upload file
1 parent 714e999 commit 001906c

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ private static PathPointsHolder buildFlingBackPathPointsHolder() {
114114
public static final int OS_SPRING_BACK = 3;
115115
public static final int OS_FLING = 4;
116116

117-
private static final int DRAG_BACK_DURATION = 420;
118-
private static final int FLING_BACK_DURATION = 700;
117+
private static final int DRAG_BACK_DURATION = 400;
118+
private static final int FLING_BACK_DURATION = 400;
119119

120120
private static final int INVALID_POINTER = -1;
121121

@@ -131,7 +131,7 @@ private static PathPointsHolder buildFlingBackPathPointsHolder() {
131131

132132
private final View mView;
133133
private final OverScrollable mOverScrollable;
134-
private boolean mEnableDragOverScroll = false;
134+
private boolean mEnableDragOverScroll = true;
135135
private boolean mEnableFlingOverScroll = true;
136136
private OverScrollStyle mStyle;
137137

@@ -247,7 +247,7 @@ public void recyclerViewAbsorbGlows(int velocityX, int velocityY) {
247247
private void onAbsorb(final int velocityY) {
248248
// offset the start of fling 1px
249249
mOffsetY = velocityY > 0 ? -1 : 1;
250-
final float overY = velocityY * 0.1f;
250+
final float overY = velocityY * 0.07f;
251251
log("velocityY->" + velocityY + " overY->" + overY);
252252
mScroller.start(overY, FLING_BACK_DURATION, sFlingBackPathPointsHolder);
253253
setState(OS_FLING);
@@ -526,7 +526,8 @@ private boolean onTouchEventInternal(MotionEvent event) {
526526
case MotionEvent.ACTION_CANCEL: {
527527
if (mOffsetY != 0f) {
528528
// Sping back to 0
529-
final int startScrollY = Math.round(mOffsetY);
529+
int boost = Math.min(400, Math.abs(mReleaseVelocityY) / 3);
530+
final int startScrollY = Math.round(mOffsetY + (mOffsetY > 0 ? boost : -boost));
530531
// mScroller.startScroll(0, startScrollY, 0, -startScrollY,
531532
// SPRING_BACK_DURATION);
532533
// mPath.reset();

0 commit comments

Comments
 (0)