public SnappyStaggeredGridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); init(); }
@Override public void smoothScrollToPosition(RecyclerView recyclerView, RecyclerView.State state, int position) { SnappySmoothScroller scroller = builder .setPosition(position) .setScrollVectorDetector(new StaggeredGridLayoutScrollVectorDetector(this)) .build(recyclerView.getContext()); startSmoothScroll(scroller); }
layoutManager = new SnappyStaggeredGridLayoutManager(3, StaggeredGridLayoutManager.VERTICAL); adapter.setVertical(true); adapter.setRandomHeight(); layoutManager = new SnappyStaggeredGridLayoutManager(3, StaggeredGridLayoutManager.HORIZONTAL); adapter.setVertical(false); adapter.setRandomWidth();
public SnappyStaggeredGridLayoutManager(int spanCount, int orientation) { super(spanCount, orientation); init(); }