Source:
<code>public int findTargetSnapPosition(RecyclerView.LayoutManager layoutManager, int velocityX, int velocityY) { final int itemCount = layoutManager.getItemCount(); if (itemCount == 0) { return RecyclerView.NO_POSITION; } OrientationHelper orientationHelper = <START> layoutManager.canScrollVertically() ? getVerticalHelper(layoutManager) : getHorizontalHelper(layoutManager); <END> View mStartMostChildView = findStartView(layoutManager, orientationHelper); if (mStartMostChildView == null) { return RecyclerView.NO_POSITION; } final int centerPosition = layoutManager.getPosition(mStartMostChildView); if (centerPosition == RecyclerView.NO_POSITION) { return RecyclerView.NO_POSITION; } final boolean forwardDirection; if (layoutManager.canScrollHorizontally()) { forwardDirection = velocityX > 0; } else { forwardDirection = velocityY > 0; } boolean reverseLayout = false; if ((layoutManager instanceof RecyclerView.SmoothScroller.ScrollVectorProvider)) { RecyclerView.SmoothScroller.ScrollVectorProvider vectorProvider = (RecyclerView.SmoothScroller.ScrollVectorProvider) layoutManager; PointF vectorForEnd = vectorProvider.computeScrollVectorForPosition(itemCount - 1); if (vectorForEnd != null) { reverseLayout = vectorForEnd.x < 0 || vectorForEnd.y < 0; } } if (centerPosition == 0 && forwardDirection == reverseLayout && distanceToCenter(layoutManager, mStartMostChildView, orientationHelper) == 0) { return RecyclerView.NO_POSITION; } return reverseLayout ? (forwardDirection ? centerPosition - 1 : centerPosition) : (forwardDirection ? centerPosition + 1 : centerPosition); }</code><technical_language>reasonable assume if a LayoutManager scroll vertically, scroll horizontally... safe assumption. I a cursory other checks for canScrollHorizontally/canScrollVertically, I find other code assumption (again cursory)</technical_language>

Target:
public int findTargetSnapPosition(RecyclerView.LayoutManager layoutManager, int velocityX, int velocityY) { final int itemCount = layoutManager.getItemCount(); if (itemCount == 0) { return RecyclerView.NO_POSITION; } OrientationHelper orientationHelper; if (layoutManager.canScrollVertically()) { orientationHelper = getVerticalHelper(layoutManager); } else if (layoutManager.canScrollHorizontally()) { orientationHelper = getHorizontalHelper(layoutManager); } else { return RecyclerView.NO_POSITION; } View mStartMostChildView = findStartView(layoutManager, orientationHelper); if (mStartMostChildView == null) { return RecyclerView.NO_POSITION; } final int centerPosition = layoutManager.getPosition(mStartMostChildView); if (centerPosition == RecyclerView.NO_POSITION) { return RecyclerView.NO_POSITION; } final boolean forwardDirection; if (layoutManager.canScrollHorizontally()) { forwardDirection = velocityX > 0; } else { forwardDirection = velocityY > 0; } boolean reverseLayout = false; if ((layoutManager instanceof RecyclerView.SmoothScroller.ScrollVectorProvider)) { RecyclerView.SmoothScroller.ScrollVectorProvider vectorProvider = (RecyclerView.SmoothScroller.ScrollVectorProvider) layoutManager; PointF vectorForEnd = vectorProvider.computeScrollVectorForPosition(itemCount - 1); if (vectorForEnd != null) { reverseLayout = vectorForEnd.x < 0 || vectorForEnd.y < 0; } } if (centerPosition == 0 && forwardDirection == reverseLayout && distanceToCenter(layoutManager, mStartMostChildView, orientationHelper) == 0) { return RecyclerView.NO_POSITION; } return reverseLayout ? (forwardDirection ? centerPosition - 1 : centerPosition) : (forwardDirection ? centerPosition + 1 : centerPosition); }