File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
ReactAndroid/src/main/java/com/facebook/react/views/scroll Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,16 @@ public void getClippingRect(Rect outClippingRect) {
302
302
303
303
@ Override
304
304
public void fling (int velocityY ) {
305
+ // Workaround.
306
+ // On Android P if a ScrollView is inverted, we will get a wrong sign for
307
+ // velocityY (see https://issuetracker.google.com/issues/112385925).
308
+ // At the same time, mOnScrollDispatchHelper tracks the correct velocity direction.
309
+ //
310
+ // Hence, we can use the absolute value from whatever the OS gives
311
+ // us and use the sign of what mOnScrollDispatchHelper has tracked.
312
+ velocityY = (int )(Math .abs (velocityY ) * Math .signum (mOnScrollDispatchHelper .getYVelocity ()));
313
+
314
+
305
315
if (mPagingEnabled ) {
306
316
smoothScrollAndSnap (velocityY );
307
317
} else if (mScroller != null ) {
You can’t perform that action at this time.
0 commit comments