public class FlexibleLayoutManager extends java.lang.Object implements IFlexibleLayoutManager
| Modifier and Type | Field and Description |
|---|---|
protected RecyclerView.LayoutManager |
mLayoutManager |
protected RecyclerView |
mRecyclerView |
| Constructor and Description |
|---|
FlexibleLayoutManager(RecyclerView.LayoutManager layoutManager)
Directly rely on the current instance of LayoutManager.
|
FlexibleLayoutManager(RecyclerView recyclerView)
Providing RecyclerView is preferable for when the LayoutManager swaps.
|
| Modifier and Type | Method and Description |
|---|---|
int |
findFirstCompletelyVisibleItemPosition()
Helper method to find the adapter position of the first completely visible view
[for each span], no matter which Layout is.
|
int |
findFirstVisibleItemPosition()
Helper method to find the adapter position of the first partially visible view
[for each span], no matter which Layout is.
|
int |
findLastCompletelyVisibleItemPosition()
Helper method to find the adapter position of the last completely visible view
[for each span], no matter which Layout is.
|
int |
findLastVisibleItemPosition()
Helper method to find the adapter position of the last partially visible view
[for each span], no matter which Layout is.
|
int |
getOrientation()
Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use.
|
int |
getSpanCount()
Helper method to retrieve the number of the columns (span count) of the given LayoutManager.
|
protected RecyclerView mRecyclerView
protected RecyclerView.LayoutManager mLayoutManager
public FlexibleLayoutManager(RecyclerView recyclerView)
recyclerView - the RecyclerView with LayoutManager in useFlexibleLayoutManager(RecyclerView.LayoutManager)public FlexibleLayoutManager(RecyclerView.LayoutManager layoutManager)
layoutManager - the current instance of LayoutManagerFlexibleLayoutManager(RecyclerView)public int getOrientation()
getOrientation in interface IFlexibleLayoutManagerOrientationHelper#HORIZONTAL, OrientationHelper#VERTICALpublic int getSpanCount()
All Layouts are supported.
getSpanCount in interface IFlexibleLayoutManagerpublic int findFirstCompletelyVisibleItemPosition()
findFirstCompletelyVisibleItemPosition in interface IFlexibleLayoutManagerRecyclerView.NO_POSITION
if there aren't any visible items.findFirstVisibleItemPosition()public int findFirstVisibleItemPosition()
findFirstVisibleItemPosition in interface IFlexibleLayoutManagerRecyclerView.NO_POSITION
if there aren't any visible items.findFirstCompletelyVisibleItemPosition()public int findLastCompletelyVisibleItemPosition()
findLastCompletelyVisibleItemPosition in interface IFlexibleLayoutManagerRecyclerView.NO_POSITION
if there aren't any visible items.findLastVisibleItemPosition()public int findLastVisibleItemPosition()
findLastVisibleItemPosition in interface IFlexibleLayoutManagerRecyclerView.NO_POSITION
if there aren't any visible items.findLastCompletelyVisibleItemPosition()