public final class LayoutUtils
extends java.lang.Object
| Constructor and Description |
|---|
LayoutUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
findFirstCompletelyVisibleItemPosition(RecyclerView recyclerView)
Helper method to find the adapter position of the first completely visible view
[for each span], no matter which Layout is.
|
static int |
findFirstVisibleItemPosition(RecyclerView recyclerView)
Helper method to find the adapter position of the first partially visible view
[for each span], no matter which Layout is.
|
static int |
findLastCompletelyVisibleItemPosition(RecyclerView recyclerView)
Helper method to find the adapter position of the last completely visible view
[for each span], no matter which Layout is.
|
static int |
findLastVisibleItemPosition(RecyclerView recyclerView)
Helper method to find the adapter position of the last partially visible view
[for each span], no matter which Layout is.
|
static java.lang.String |
getClassName(java.lang.Object o) |
static java.lang.String |
getModeName(int mode) |
static int |
getOrientation(RecyclerView recyclerView)
Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use.
|
static int |
getSpanCount(RecyclerView recyclerView)
Helper method to retrieve the number of the columns (span count) of the given LayoutManager.
|
public static java.lang.String getModeName(int mode)
SelectableAdapter.Modepublic static java.lang.String getClassName(java.lang.Object o)
public static int getOrientation(RecyclerView recyclerView)
recyclerView - the RecyclerView with LayoutManager instance in useOrientationHelper#HORIZONTAL, OrientationHelper#VERTICALpublic static int getSpanCount(RecyclerView recyclerView)
All Layouts are supported.
recyclerView - the RecyclerView with LayoutManager instance in usepublic static int findFirstCompletelyVisibleItemPosition(RecyclerView recyclerView)
recyclerView - the RecyclerView with LayoutManager instance in useRecyclerView.NO_POSITION
if there aren't any visible items.findFirstVisibleItemPosition(RecyclerView)public static int findFirstVisibleItemPosition(RecyclerView recyclerView)
recyclerView - the RecyclerView with LayoutManager instance in useRecyclerView.NO_POSITION
if there aren't any visible items.findFirstCompletelyVisibleItemPosition(RecyclerView)public static int findLastCompletelyVisibleItemPosition(RecyclerView recyclerView)
recyclerView - the RecyclerView with LayoutManager instance in useRecyclerView.NO_POSITION
if there aren't any visible items.findLastVisibleItemPosition(RecyclerView)public static int findLastVisibleItemPosition(RecyclerView recyclerView)
recyclerView - the RecyclerView with LayoutManager instance in useRecyclerView.NO_POSITION
if there aren't any visible items.findLastCompletelyVisibleItemPosition(RecyclerView)