Source:
private void fillVisibleItemsWithDetachedViews( @NonNull BOUND totalDataStartBound, @NonNull BOUND totalDataEndBound, @NonNull BOUND visibleStartBound, @NonNull BOUND visibleEndBound, int visibleTop, int visibleBottom, @NonNull RecyclerView.Recycler recycler) { if (adapter == null) { throwAdapterNotSetException(); } Collection<ROW> rows = adapter.getRows(); if (rows.isEmpty()) { return; } int roundingErrorX = scrollX - getLengthPx(totalDataStartBound, visibleStartBound); int y = -scrollY; boolean isFirstRow, isLastRow; int rowIndex = 0; int lastRowIndex = rows.size() - 1; int placeholdersCount = 0; boolean visibleVerticalRange = false; int firstRowIndex = -1; int firstRowPositionY = 0; List<String> rowsLabels = initializeRowsLabels(); for (ROW row : rows) { if (y >= visibleBottom) { break; } if (!visibleVerticalRange && y + rowHeightPx > visibleTop) { visibleVerticalRange = true; firstRowIndex = rowIndex; firstRowPositionY = y; } if (visibleVerticalRange) { isFirstRow = rowIndex == 0; isLastRow = rowIndex == lastRowIndex; addRowLabel(rowsLabels, row); for (RangePosition<BOUND> rangePosition : adapter.getPositionsIn(row, visibleStartBound, visibleEndBound)) { View view = recycler.getViewForPosition(rangePosition.getPosition()); TableViewHolder<?, ROW, BOUND> viewHolder = adapter.getViewHolder(view); updateLayoutParamsForView(viewHolder, totalDataStartBound, totalDataEndBound, isFirstRow, isLastRow); int viewIndex = viewHolder.isPlaceholder() ? placeholdersCount++ : VIEW_INDEX_END; addView(view, viewIndex); int width = getLengthPx(viewHolder.getStart(), viewHolder.getEnd()); int x = getLengthPx(visibleStartBound, viewHolder.getStart()) + roundingErrorX; measureAndLayoutChildWithDecorations(view, width, rowHeightPx, x, y); } } y += rowHeightPx; rowIndex++; } updateBoundsRuler(totalDataStartBound, visibleStartBound); updateRowsRuler(firstRowIndex, firstRowPositionY, rowsLabels); adapter.onReleaseRowsPositionsResources(); }

Target:
private void fillVisibleItemsWithDetachedViews( @NonNull BOUND totalDataStartBound, @NonNull BOUND totalDataEndBound, @NonNull BOUND visibleStartBound, @NonNull BOUND visibleEndBound, int visibleTop, int visibleBottom, @NonNull RecyclerView.Recycler recycler) { if (adapter == null) { throwAdapterNotSetException(); } Collection<ROW> rows = adapter.getRows(); if (rows.isEmpty()) { return; } int roundingErrorX = scrollX - getLengthPx(totalDataStartBound, visibleStartBound); int y = -scrollY; boolean isFirstRow, isLastRow; int rowIndex = 0; int lastRowIndex = rows.size() - 1; int placeholdersCount = 0; boolean isVisibleVerticalRange = false; int firstRowIndex = -1; int firstRowPositionY = 0; List<String> rowsLabels = initializeRowsLabels(); for (ROW row : rows) { if (y >= visibleBottom) { break; } if (!isVisibleVerticalRange && y + rowHeightPx > visibleTop) { isVisibleVerticalRange = true; firstRowIndex = rowIndex; firstRowPositionY = y; } if (isVisibleVerticalRange) { isFirstRow = rowIndex == 0; isLastRow = rowIndex == lastRowIndex; addRowLabel(rowsLabels, row); for (RangePosition<BOUND> rangePosition : adapter.getPositionsIn(row, visibleStartBound, visibleEndBound)) { View view = recycler.getViewForPosition(rangePosition.getPosition()); TableViewHolder<?, ROW, BOUND> viewHolder = adapter.getViewHolder(view); updateLayoutParamsForView(viewHolder, totalDataStartBound, totalDataEndBound, isFirstRow, isLastRow); int viewIndex = viewHolder.isPlaceholder() ? placeholdersCount++ : VIEW_INDEX_END; addView(view, viewIndex); int width = getLengthPx(viewHolder.getStart(), viewHolder.getEnd()); int x = getLengthPx(visibleStartBound, viewHolder.getStart()) + roundingErrorX; measureAndLayoutChildWithDecorations(view, width, rowHeightPx, x, y); } } y += rowHeightPx; rowIndex++; } updateRowsRuler(firstRowIndex, firstRowPositionY, rowsLabels); updateBoundsRuler(totalDataStartBound, visibleStartBound); adapter.onReleaseRowsPositionsResources(); }