v7/recyclerview/src/main/java/androidx/recyclerview/widget/AsyncListUtil.java
@UiThread
        public void extendRangeInto(@NonNull int[] range, @NonNull int[] outRange, int scrollHint) {
            final int fullRange = range[1] - range[0] + 1;
            final int halfRange = fullRange / 2;
            outRange[0] = range[0] - (scrollHint == HINT_SCROLL_DESC ? fullRange : halfRange);
            outRange[1] = range[1] + (scrollHint == HINT_SCROLL_ASC ? fullRange : halfRange);
        }
/**
         * Compute a wider range of items that will be loaded for smoother scrolling.
         *
         * <p>
         * If there is no scroll hint, the default implementation extends the visible range by half
         * its length in both directions. If there is a scroll hint, the range is extended by
         * its full length in the scroll direction, and by half in the other direction.
         * <p>
         * For example, if <code>range</code> is <code>{100, 200}</code> and <code>scrollHint</code>
         * is {@link #HINT_SCROLL_ASC}, then <code>outRange</code> will be <code>{50, 300}</code>.
         * <p>
         * However, if <code>scrollHint</code> is {@link #HINT_SCROLL_NONE}, then
         * <code>outRange</code> will be <code>{50, 250}</code>
         *
         * @param range Visible item range.
         * @param outRange Extended range.
         * @param scrollHint The scroll direction hint.
         */
Compute a wider range of items that will be loaded for smoother scrolling.

If there is no scroll hint, the default implementation extends the visible range by half
its length in both directions. If there is a scroll hint, the range is extended by
its full length in the scroll direction, and by half in the other direction.

For example, if range is {100, 200} and scrollHint
is  #HINT_SCROLL_ASC, then outRange will be {50, 300}.

However, if scrollHint is  #HINT_SCROLL_NONE, then
outRange will be {50, 250}

@param range Visible item range.
@param outRange Extended range.
@param scrollHint The scroll direction hint.
Compute a wider range of items that will be loaded for smoother scrolling . If there is no scroll hint the default implementation extends the visible range by half its length in both directions . If there is a scroll hint the range is extended by its full length in the scroll direction and by half in the other direction . For example if range is { 100 200 } and scrollHint is #HINT_SCROLL_ASC then outRange will be { 50 300 } . However if scrollHint is #HINT_SCROLL_NONE then outRange will be { 50 250 } @param range Visible item range . @param outRange Extended range . @param scrollHint The scroll direction hint .
@UiThread
        public void extendRangeInto(@NonNull int[] range, @NonNull int[] outRange, int scrollHint) {
            final int fullRange = range[1] - range[0] + 1;
            final int halfRange = fullRange / 2;
            outRange[0] = range[0] - (scrollHint == HINT_SCROLL_DESC ? fullRange : halfRange);
            outRange[1] = range[1] + (scrollHint == HINT_SCROLL_ASC ? fullRange : halfRange);
        }
@ UiThread public void extendRangeInto ( @ NonNull int [ ] range , @ NonNull int [ ] outRange , int scrollHint ) { final int fullRange = range [ 1 ] - range [ 0 ] + 1 ; final int halfRange = fullRange / 2 ; outRange [ 0 ] = range [ 0 ] - ( scrollHint == HINT_SCROLL_DESC ? fullRange : halfRange ) ; outRange [ 1 ] = range [ 1 ] + ( scrollHint == HINT_SCROLL_ASC ? fullRange : halfRange ) ; }
Compute a wider range of items that will be loaded for smoother scrolling.
Compute a wider range of items that will be loaded for smoother scrolling .