public interface LayoutInfo extends ViewportInfo
RecyclerBinder with all the
information about the RecyclerView layout.| Modifier and Type | Interface and Description |
|---|---|
static interface |
LayoutInfo.RenderInfoCollection |
static interface |
LayoutInfo.ViewportFiller
Interface that is responsible for filling the viewport of the list with initial layouts
according to the LayoutManager.
|
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 |
computeWrappedHeight(int maxHeight,
List<ComponentTreeHolder> componentTreeHolders) |
LayoutInfo.ViewportFiller |
createViewportFiller(int measuredWidth,
int measuredHeight) |
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 |
scrollToPositionWithOffset(int position,
int offset)
RecyclerBinder delegates scrolling responsibilities to the LayoutInfo, as the varied
LayoutManagers wrapped by a LayoutInfo lack a common scrolling interface.
|
void |
setRenderInfoCollection(LayoutInfo.RenderInfoCollection renderInfoCollection) |
findFirstFullyVisibleItemPosition, findFirstVisibleItemPosition, findLastFullyVisibleItemPosition, findLastVisibleItemPosition, getItemCountint 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 - void scrollToPositionWithOffset(int position,
int offset)
position - Index of the item in the adapteroffset - Additional adjustment to control the precise position the scroll moves to.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 GridLayoutInfoRecyclerBinder.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 GridLayoutInfoRecyclerBinder.LayoutInfo.ViewportFiller createViewportFiller(int measuredWidth, int measuredHeight)
measuredWidth - the width of the RecyclerViewmeasuredHeight - the height of the RecyclerViewLayoutInfo.ViewportFiller to fill the RecyclerView viewport with views, or null to not
pre-fill the RecyclerView.int computeWrappedHeight(int maxHeight,
List<ComponentTreeHolder> componentTreeHolders)
maxHeight - the max height of the parent RecyclerSpec.componentTreeHolders - the list of ComponentTreeHolder in this RecyclerBinder.RecyclerBinder.