leanback/src/main/java/androidx/leanback/widget/Grid.java
public void removeInvisibleItemsAtFront(int belowIndex, int toLimit) {
        while(mLastVisibleIndex >= mFirstVisibleIndex && mFirstVisibleIndex < belowIndex) {
            final int size = mProvider.getSize(mFirstVisibleIndex);
            boolean offFront = !mReversedFlow
                    ? mProvider.getEdge(mFirstVisibleIndex) + size <= toLimit
                    : mProvider.getEdge(mFirstVisibleIndex) - size >= toLimit;
            if (offFront) {
                mProvider.removeItem(mFirstVisibleIndex);
                mFirstVisibleIndex++;
            } else {
                break;
            }
        }
        resetVisibleIndexIfEmpty();
    }
/**
     * Removes invisible items from front until reaches item at belowIndex or toLimit.
     * @param belowIndex Don't remove items whose index is equals or larger than belowIndex
     * @param toLimit Don't remove items whose right edge is equals or greater than toLimit.
     */
Removes invisible items from front until reaches item at belowIndex or toLimit.
@param belowIndex Don't remove items whose index is equals or larger than belowIndex
@param toLimit Don't remove items whose right edge is equals or greater than toLimit.
Removes invisible items from front until reaches item at belowIndex or toLimit . @param belowIndex Don ' t remove items whose index is equals or larger than belowIndex @param toLimit Don ' t remove items whose right edge is equals or greater than toLimit .
public void removeInvisibleItemsAtFront(int belowIndex, int toLimit) {
        while(mLastVisibleIndex >= mFirstVisibleIndex && mFirstVisibleIndex < belowIndex) {
            final int size = mProvider.getSize(mFirstVisibleIndex);
            boolean offFront = !mReversedFlow
                    ? mProvider.getEdge(mFirstVisibleIndex) + size <= toLimit
                    : mProvider.getEdge(mFirstVisibleIndex) - size >= toLimit;
            if (offFront) {
                mProvider.removeItem(mFirstVisibleIndex);
                mFirstVisibleIndex++;
            } else {
                break;
            }
        }
        resetVisibleIndexIfEmpty();
    }
public void removeInvisibleItemsAtFront ( int belowIndex , int toLimit ) { while ( mLastVisibleIndex >= mFirstVisibleIndex && mFirstVisibleIndex < belowIndex ) { final int size = mProvider . getSize ( mFirstVisibleIndex ) ; boolean offFront = ! mReversedFlow ? mProvider . getEdge ( mFirstVisibleIndex ) + size <= toLimit : mProvider . getEdge ( mFirstVisibleIndex ) - size >= toLimit ; if ( offFront ) { mProvider . removeItem ( mFirstVisibleIndex ) ; mFirstVisibleIndex ++ ; } else { break ; } } resetVisibleIndexIfEmpty ( ) ; }
Removes invisible items from front until reaches item at belowIndex or toLimit.
Removes invisible items from front until reaches item at belowIndex or toLimit .