@@ -1372,36 +1372,37 @@ private void handleScrollOnDraggingInternalWithRecyclerView(RecyclerView rv, boo
13721372 decorator .setIsScrolling (false );
13731373 }
13741374
1375- final boolean actualIsScrolling = (actualScrolledAmount != 0 );
1376-
1377-
13781375 if (mEdgeEffectDecorator != null ) {
1379- final float edgeEffectStrength = 0.005f ;
1380-
1381- final int draggingItemTopLeft = (horizontal ) ? decorator .getTranslatedItemPositionLeft () : decorator .getTranslatedItemPositionTop ();
1382- final int draggingItemBottomRight = (horizontal ) ? decorator .getTranslatedItemPositionRight () : decorator .getTranslatedItemPositionBottom ();
1383- final int draggingItemCenter = (draggingItemTopLeft + draggingItemBottomRight ) / 2 ;
1384- final int nearEdgePosition ;
1376+ float edgeEffectPullDistance = 0 ;
13851377
1386- if (firstVisibleChild == 0 && lastVisibleChild == 0 ) {
1387- // has only 1 item
1388- nearEdgePosition = (scrollAmount < 0 ) ? draggingItemTopLeft : draggingItemBottomRight ;
1389- } else {
1390- nearEdgePosition = (draggingItemCenter < (edge / 2 )) ? draggingItemTopLeft : draggingItemBottomRight ;
1391- }
1378+ if (mOrigOverScrollMode != View .OVER_SCROLL_NEVER ) {
1379+ final boolean actualIsScrolling = (actualScrolledAmount != 0 );
1380+ final float edgeEffectStrength = 0.005f ;
13921381
1393- final float nearEdgeOffset = (nearEdgePosition * invEdge ) - 0.5f ;
1394- final float absNearEdgeOffset = Math .abs (nearEdgeOffset );
1395- float edgeEffectPullDistance = 0 ;
1382+ final int draggingItemTopLeft = (horizontal ) ? decorator .getTranslatedItemPositionLeft () : decorator .getTranslatedItemPositionTop ();
1383+ final int draggingItemBottomRight = (horizontal ) ? decorator .getTranslatedItemPositionRight () : decorator .getTranslatedItemPositionBottom ();
1384+ final int draggingItemCenter = (draggingItemTopLeft + draggingItemBottomRight ) / 2 ;
1385+ final int nearEdgePosition ;
13961386
1397- if ((absNearEdgeOffset > 0.4f ) && (scrollAmount != 0 ) && !actualIsScrolling ) {
1398- if (nearEdgeOffset < 0 ) {
1399- if (horizontal ? decorator .isReachedToLeftLimit () : decorator .isReachedToTopLimit ()) {
1400- edgeEffectPullDistance = -mDisplayDensity * edgeEffectStrength ;
1401- }
1387+ if (firstVisibleChild == 0 && lastVisibleChild == 0 ) {
1388+ // has only 1 item
1389+ nearEdgePosition = (scrollAmount < 0 ) ? draggingItemTopLeft : draggingItemBottomRight ;
14021390 } else {
1403- if (horizontal ? decorator .isReachedToRightLimit () : decorator .isReachedToBottomLimit ()) {
1404- edgeEffectPullDistance = mDisplayDensity * edgeEffectStrength ;
1391+ nearEdgePosition = (draggingItemCenter < (edge / 2 )) ? draggingItemTopLeft : draggingItemBottomRight ;
1392+ }
1393+
1394+ final float nearEdgeOffset = (nearEdgePosition * invEdge ) - 0.5f ;
1395+ final float absNearEdgeOffset = Math .abs (nearEdgeOffset );
1396+
1397+ if ((absNearEdgeOffset > 0.4f ) && (scrollAmount != 0 ) && !actualIsScrolling ) {
1398+ if (nearEdgeOffset < 0 ) {
1399+ if (horizontal ? decorator .isReachedToLeftLimit () : decorator .isReachedToTopLimit ()) {
1400+ edgeEffectPullDistance = -mDisplayDensity * edgeEffectStrength ;
1401+ }
1402+ } else {
1403+ if (horizontal ? decorator .isReachedToRightLimit () : decorator .isReachedToBottomLimit ()) {
1404+ edgeEffectPullDistance = mDisplayDensity * edgeEffectStrength ;
1405+ }
14051406 }
14061407 }
14071408 }
0 commit comments