@UiThreadTest @Test public void scrollWithoutLayout() throws Throwable { final RecyclerView recyclerView = setupBasic(new Config(3, 100)); mGlm.expectLayout(1); setRecyclerView(recyclerView); mGlm.setSpanCount(5); recyclerView.scrollBy(0, 10); }
public void setSpanCount(int spanCount) { if (spanCount == mSpanCount) { return; } mPendingSpanCountChange = true; if (spanCount < 1) { throw new IllegalArgumentException("Span count should be at least 1. Provided " + spanCount); } mSpanCount = spanCount; mSpanSizeLookup.invalidateSpanIndexCache(); requestLayout(); }
GridLayoutManager extends LinearLayoutManager { public void setSpanCount(int spanCount) { if (spanCount == mSpanCount) { return; } mPendingSpanCountChange = true; if (spanCount < 1) { throw new IllegalArgumentException("Span count should be at least 1. Provided " + spanCount); } mSpanCount = spanCount; mSpanSizeLookup.invalidateSpanIndexCache(); requestLayout(); } }
GridLayoutManager extends LinearLayoutManager { public void setSpanCount(int spanCount) { if (spanCount == mSpanCount) { return; } mPendingSpanCountChange = true; if (spanCount < 1) { throw new IllegalArgumentException("Span count should be at least 1. Provided " + spanCount); } mSpanCount = spanCount; mSpanSizeLookup.invalidateSpanIndexCache(); requestLayout(); } GridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr,
                             int defStyleRes);  GridLayoutManager(Context context, int spanCount);  GridLayoutManager(Context context, int spanCount,
            @RecyclerView.Orientation int orientation, boolean reverseLayout); }
GridLayoutManager extends LinearLayoutManager { public void setSpanCount(int spanCount) { if (spanCount == mSpanCount) { return; } mPendingSpanCountChange = true; if (spanCount < 1) { throw new IllegalArgumentException("Span count should be at least 1. Provided " + spanCount); } mSpanCount = spanCount; mSpanSizeLookup.invalidateSpanIndexCache(); requestLayout(); } GridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr,
                             int defStyleRes);  GridLayoutManager(Context context, int spanCount);  GridLayoutManager(Context context, int spanCount,
            @RecyclerView.Orientation int orientation, boolean reverseLayout); @Override void setStackFromEnd(boolean stackFromEnd); @Override int getRowCountForAccessibility(RecyclerView.Recycler recycler,
            RecyclerView.State state); @Override int getColumnCountForAccessibility(RecyclerView.Recycler recycler,
            RecyclerView.State state); @Override void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
            RecyclerView.State state, View host, AccessibilityNodeInfoCompat info); @Override void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state); @Override void onLayoutCompleted(RecyclerView.State state); @Override void onItemsAdded(RecyclerView recyclerView, int positionStart, int itemCount); @Override void onItemsChanged(RecyclerView recyclerView); @Override void onItemsRemoved(RecyclerView recyclerView, int positionStart, int itemCount); @Override void onItemsUpdated(RecyclerView recyclerView, int positionStart, int itemCount,
            Object payload); @Override void onItemsMoved(RecyclerView recyclerView, int from, int to, int itemCount); @Override RecyclerView.LayoutParams generateDefaultLayoutParams(); @Override RecyclerView.LayoutParams generateLayoutParams(Context c, AttributeSet attrs); @Override RecyclerView.LayoutParams generateLayoutParams(ViewGroup.LayoutParams lp); @Override boolean checkLayoutParams(RecyclerView.LayoutParams lp); void setSpanSizeLookup(SpanSizeLookup spanSizeLookup); SpanSizeLookup getSpanSizeLookup(); @Override void setMeasuredDimension(Rect childrenBounds, int wSpec, int hSpec); @Override int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler,
            RecyclerView.State state); @Override int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler,
            RecyclerView.State state); int getSpanCount(); void setSpanCount(int spanCount); @Override View onFocusSearchFailed(View focused, int focusDirection,
            RecyclerView.Recycler recycler, RecyclerView.State state); @Override boolean supportsPredictiveItemAnimations(); }
GridLayoutManager extends LinearLayoutManager { public void setSpanCount(int spanCount) { if (spanCount == mSpanCount) { return; } mPendingSpanCountChange = true; if (spanCount < 1) { throw new IllegalArgumentException("Span count should be at least 1. Provided " + spanCount); } mSpanCount = spanCount; mSpanSizeLookup.invalidateSpanIndexCache(); requestLayout(); } GridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr,
                             int defStyleRes);  GridLayoutManager(Context context, int spanCount);  GridLayoutManager(Context context, int spanCount,
            @RecyclerView.Orientation int orientation, boolean reverseLayout); @Override void setStackFromEnd(boolean stackFromEnd); @Override int getRowCountForAccessibility(RecyclerView.Recycler recycler,
            RecyclerView.State state); @Override int getColumnCountForAccessibility(RecyclerView.Recycler recycler,
            RecyclerView.State state); @Override void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
            RecyclerView.State state, View host, AccessibilityNodeInfoCompat info); @Override void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state); @Override void onLayoutCompleted(RecyclerView.State state); @Override void onItemsAdded(RecyclerView recyclerView, int positionStart, int itemCount); @Override void onItemsChanged(RecyclerView recyclerView); @Override void onItemsRemoved(RecyclerView recyclerView, int positionStart, int itemCount); @Override void onItemsUpdated(RecyclerView recyclerView, int positionStart, int itemCount,
            Object payload); @Override void onItemsMoved(RecyclerView recyclerView, int from, int to, int itemCount); @Override RecyclerView.LayoutParams generateDefaultLayoutParams(); @Override RecyclerView.LayoutParams generateLayoutParams(Context c, AttributeSet attrs); @Override RecyclerView.LayoutParams generateLayoutParams(ViewGroup.LayoutParams lp); @Override boolean checkLayoutParams(RecyclerView.LayoutParams lp); void setSpanSizeLookup(SpanSizeLookup spanSizeLookup); SpanSizeLookup getSpanSizeLookup(); @Override void setMeasuredDimension(Rect childrenBounds, int wSpec, int hSpec); @Override int scrollHorizontallyBy(int dx, RecyclerView.Recycler recycler,
            RecyclerView.State state); @Override int scrollVerticallyBy(int dy, RecyclerView.Recycler recycler,
            RecyclerView.State state); int getSpanCount(); void setSpanCount(int spanCount); @Override View onFocusSearchFailed(View focused, int focusDirection,
            RecyclerView.Recycler recycler, RecyclerView.State state); @Override boolean supportsPredictiveItemAnimations(); static final int DEFAULT_SPAN_COUNT; }