-
- All Implemented Interfaces:
-
eu.davidea.flexibleadapter.common.IFlexibleLayoutManager
public class FlexibleLayoutManager implements IFlexibleLayoutManager
Internal wrapper class for all conventional LayoutManagers.
-
-
Constructor Summary
Constructors Constructor Description FlexibleLayoutManager(RecyclerView recyclerView)Providing RecyclerView is preferable for when the LayoutManager swaps. FlexibleLayoutManager(RecyclerView.LayoutManager layoutManager)Directly rely on the current instance of LayoutManager.Using this constructor it won't update the internal instance on LayoutManager swapping.
-
Method Summary
Modifier and Type Method Description intgetOrientation()Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use. intgetSpanCount()Helper method to retrieve the number of the columns (span count) of the given LayoutManager. intfindFirstCompletelyVisibleItemPosition()Helper method to find the adapter position of the first completely visible view[for each span], no matter which Layout is. intfindFirstVisibleItemPosition()Helper method to find the adapter position of the first partially visible view[for each span], no matter which Layout is. intfindLastCompletelyVisibleItemPosition()Helper method to find the adapter position of the last completely visible view[for each span], no matter which Layout is. intfindLastVisibleItemPosition()Helper method to find the adapter position of the last partially visible view[for each span], no matter which Layout is. -
-
Constructor Detail
-
FlexibleLayoutManager
FlexibleLayoutManager(RecyclerView recyclerView)
Providing RecyclerView is preferable for when the LayoutManager swaps.- Parameters:
recyclerView- the RecyclerView with LayoutManager in use
-
FlexibleLayoutManager
FlexibleLayoutManager(RecyclerView.LayoutManager layoutManager)
Directly rely on the current instance of LayoutManager.Using this constructor it won't update the internal instance on LayoutManager swapping.- Parameters:
layoutManager- the current instance of LayoutManager
-
-
Method Detail
-
getOrientation
int getOrientation()
Finds the layout orientation of the RecyclerView, no matter which LayoutManager is in use.
-
getSpanCount
int getSpanCount()
Helper method to retrieve the number of the columns (span count) of the given LayoutManager.
All Layouts are supported.
-
findFirstCompletelyVisibleItemPosition
int findFirstCompletelyVisibleItemPosition()
Helper method to find the adapter position of the first completely visible view[for each span], no matter which Layout is.
-
findFirstVisibleItemPosition
int findFirstVisibleItemPosition()
Helper method to find the adapter position of the first partially visible view[for each span], no matter which Layout is.
-
findLastCompletelyVisibleItemPosition
int findLastCompletelyVisibleItemPosition()
Helper method to find the adapter position of the last completely visible view[for each span], no matter which Layout is.
-
findLastVisibleItemPosition
int findLastVisibleItemPosition()
Helper method to find the adapter position of the last partially visible view[for each span], no matter which Layout is.
-
-
-
-