public interface LayoutInfo extends ViewportInfo
RecyclerBinder
with all the
information about the RecyclerView
layout.Modifier and Type | Interface and Description |
---|---|
static interface |
LayoutInfo.RenderInfoCollection |
ViewportInfo.State, ViewportInfo.ViewportChanged
Modifier and Type | Method and Description |
---|---|
int |
approximateRangeSize(int firstMeasuredItemWidth,
int firstMeasuredItemHeight,
int recyclerMeasuredWidth,
int recyclerMeasuredHeight)
This is called when the
RecyclerBinder needs to calculate a range size. |
int |
getChildHeightSpec(int heightSpec,
RenderInfo renderInfo) |
int |
getChildWidthSpec(int widthSpec,
RenderInfo renderInfo) |
LayoutManager |
getLayoutManager() |
int |
getScrollDirection()
This is the main scrolling direction that the
LayoutManager passed to this binder will
use. |
void |
setRenderInfoCollection(LayoutInfo.RenderInfoCollection renderInfoCollection) |
findFirstFullyVisibleItemPosition, findFirstVisibleItemPosition, findLastFullyVisibleItemPosition, findLastVisibleItemPosition, getItemCount
int getScrollDirection()
LayoutManager
passed to this binder will
use.OrientationHelper#HORIZONTAL
or OrientationHelper#VERTICAL
.LayoutManager getLayoutManager()
LayoutManager
to be used with the RecyclerView
.void setRenderInfoCollection(LayoutInfo.RenderInfoCollection renderInfoCollection)
renderInfoCollection
- int approximateRangeSize(int firstMeasuredItemWidth, int firstMeasuredItemHeight, int recyclerMeasuredWidth, int recyclerMeasuredHeight)
RecyclerBinder
needs to calculate a range size.
The returned value should be an approximate range size based on the size of the first measured
item.firstMeasuredItemWidth
- The width of the first item measured while computing the range.firstMeasuredItemHeight
- The height of the first item measured while computing the range.recyclerMeasuredWidth
- The measured width of the RecyclerView. If the RecyclerView
scrolls vertically this might be not significant.recyclerMeasuredHeight
- The measured height of the RecyclerView. If the RecyclerView
scrolls horizontally this might be not significant.int getChildWidthSpec(int widthSpec, RenderInfo renderInfo)
widthSpec
- the widthSpec used to measure the parent RecyclerSpec
.renderInfo
- retrieve SpanSize of the component if it is a GridLayoutInfo
RecyclerBinder
.int getChildHeightSpec(int heightSpec, RenderInfo renderInfo)
heightSpec
- the heightSpec used to measure the parent RecyclerSpec
.renderInfo
- retrieve SpanSize of the component if it is a GridLayoutInfo
RecyclerBinder
.