Android examples for User Interface:RecyclerView
get RecyclerView Span Size
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import java.util.ArrayList; public class Main{ private static Integer getSpanSize(RecyclerView rv) { final RecyclerView.LayoutManager lm = rv.getLayoutManager(); if (lm != null && lm instanceof GridLayoutManager) return ((GridLayoutManager) lm).getSpanCount(); return 1; }/*from w w w . ja v a 2 s. c o m*/ }