File tree 1 file changed +8
-1
lines changed
ReactAndroid/src/main/java/com/facebook/react/views/scroll 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -314,8 +314,15 @@ public void fling(int velocityY) {
314
314
//
315
315
// Hence, we can use the absolute value from whatever the OS gives
316
316
// us and use the sign of what mOnScrollDispatchHelper has tracked.
317
- final int correctedVelocityY = (int )(Math .abs (velocityY ) * Math .signum (mOnScrollDispatchHelper .getYFlingVelocity ()));
317
+ // final int correctedVelocityY = (int)(Math.abs(velocityY) * Math.signum(mOnScrollDispatchHelper.getYFlingVelocity()));
318
318
319
+ //BEGIN pavel.rotek wrong velocity on old phones
320
+ float signum = Math .signum (mOnScrollDispatchHelper .getYFlingVelocity ());
321
+ if (signum == 0 ) {
322
+ signum = Math .signum (velocityY );
323
+ }
324
+ final int correctedVelocityY = (int )(Math .abs (velocityY ) * signum );
325
+ //END
319
326
320
327
if (mPagingEnabled ) {
321
328
flingAndSnap (correctedVelocityY );
You can’t perform that action at this time.
0 commit comments