-
public final class LayoutUtils
-
-
Method Summary
Modifier and Type Method Description static StringgetModeName(int mode)static StringgetClassName(@Nullable() Object o)static intgetOrientation(RecyclerView recyclerView)Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use. static intgetSpanCount(RecyclerView recyclerView)Helper method to retrieve the number of the columns (span count) of the given LayoutManager. static intfindFirstCompletelyVisibleItemPosition(RecyclerView recyclerView)Helper method to find the adapter position of the first completely visible view[for each span], no matter which Layout is. static intfindFirstVisibleItemPosition(RecyclerView recyclerView)Helper method to find the adapter position of the first partially visible view[for each span], no matter which Layout is. static intfindLastCompletelyVisibleItemPosition(RecyclerView recyclerView)Helper method to find the adapter position of the last completely visible view[for each span], no matter which Layout is. static intfindLastVisibleItemPosition(RecyclerView recyclerView)Helper method to find the adapter position of the last partially visible view[for each span], no matter which Layout is. -
-
Method Detail
-
getModeName
@NonNull() static String getModeName(int mode)
-
getClassName
@NonNull() static String getClassName(@Nullable() Object o)
-
getOrientation
static int getOrientation(RecyclerView recyclerView)
Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use.
- Parameters:
recyclerView- the RecyclerView with LayoutManager instance in use
-
getSpanCount
static int getSpanCount(RecyclerView recyclerView)
Helper method to retrieve the number of the columns (span count) of the given LayoutManager.
All Layouts are supported.
- Parameters:
recyclerView- the RecyclerView with LayoutManager instance in use
-
findFirstCompletelyVisibleItemPosition
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.
- Parameters:
recyclerView- the RecyclerView with LayoutManager instance in use
-
findFirstVisibleItemPosition
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.
- Parameters:
recyclerView- the RecyclerView with LayoutManager instance in use
-
findLastCompletelyVisibleItemPosition
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.
- Parameters:
recyclerView- the RecyclerView with LayoutManager instance in use
-
findLastVisibleItemPosition
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.
- Parameters:
recyclerView- the RecyclerView with LayoutManager instance in use
-
-
-
-