RecyclerBinder

This binder class is used to asynchronously layout Components given a list of Component and attaching them to a RecyclerSpec.

Types

Link copied to clipboard
open class Builder
Link copied to clipboard
Defines when a batch should be committed: - IMMEDIATE: Commit batches to the RecyclerView as soon as possible.
Link copied to clipboard
annotation class RecyclingStrategy
Strategies for recycling layouts of items in binder

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun appendItem(component: Component)
fun appendItem(renderInfo: RenderInfo)
Inserts a new item at tail.
Link copied to clipboard
open fun bind(view: RecyclerView)
Bind this Binder to a View.
Link copied to clipboard
open fun canMeasure(): Boolean
Only for horizontally scrolling layouts: return true if height is not known when measuring the view and the first item will be measured to determine the height.
Link copied to clipboard
Removes all items in this binder async.
Link copied to clipboard
open fun detach()
Detach items under the hood.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns the ComponentTree for the item at index position.
Link copied to clipboard
Link copied to clipboard
open fun getItemCount(): Int
Gets the number of items currently in the adapter attached to this binder (i.e.
Link copied to clipboard
Link copied to clipboard
fun insertItemAt(position: Int, component: Component)
fun insertItemAt(position: Int, renderInfo: RenderInfo)
Inserts a new item at position.
Link copied to clipboard
fun insertItemAtAsync(position: Int, renderInfo: RenderInfo)
Inserts an item at position.
Link copied to clipboard
fun insertRangeAt(position: Int, renderInfos: List<RenderInfo>)
Inserts the new items starting from position.
Link copied to clipboard
fun insertRangeAtAsync(position: Int, renderInfos: List<RenderInfo>)
Inserts the new items starting from position.
Link copied to clipboard
open fun isSticky(position: Int): Boolean
Link copied to clipboard
open fun isValidPosition(position: Int): Boolean
Link copied to clipboard
Return true if wrap content is enabled, false otherwise.
Link copied to clipboard
open fun measure(outSize: Size, widthSpec: Int, heightSpec: Int, @Nullable reMeasureEventHandler: EventHandler<ReMeasureEvent>)
A component mounting a RecyclerView can use this method to determine its size.
Link copied to clipboard
open fun mount(view: RecyclerView)
Call from the owning Component's onMount.
Link copied to clipboard
fun moveItem(fromPosition: Int, toPosition: Int)
Moves an item from fromPosition to toPosition.
Link copied to clipboard
fun moveItemAsync(fromPosition: Int, toPosition: Int)
Moves an item from fromPosition to toPosition.
Link copied to clipboard
open fun notifyChangeSetComplete(isDataChanged: Boolean, @Nullable changeSetCompleteCallback: ChangeSetCompleteCallback)
Called after all the change set operations (inserts, removes, etc.) in a batch have completed.
Link copied to clipboard
open fun notifyChangeSetCompleteAsync(isDataChanged: Boolean, changeSetCompleteCallback: ChangeSetCompleteCallback)
Called after all the change set operations (inserts, removes, etc.) in a batch have completed.
Link copied to clipboard
open fun notifyItemRenderCompleteAt(position: Int, timestampMillis: Long)
Link copied to clipboard
fun removeItemAt(position: Int)
Removes an item from index position.
Link copied to clipboard
fun removeItemAtAsync(position: Int)
Removes an item from position.
Link copied to clipboard
fun removeRangeAt(position: Int, count: Int)
Removes count items starting from position.
Link copied to clipboard
fun removeRangeAtAsync(position: Int, count: Int)
Removes count items starting from position.
Link copied to clipboard
Link copied to clipboard
fun replaceAll(renderInfos: List<RenderInfo>)
Replaces all items in the RecyclerBinder with the provided RenderInfos.
Link copied to clipboard
Link copied to clipboard
open fun scrollToPosition(position: Int)
Link copied to clipboard
open fun scrollToPositionWithOffset(position: Int, offset: Int)
Link copied to clipboard
open fun setCanMeasure(canMeasure: Boolean)
Only for horizontally scrolling layouts: set to true if height is not known when measuring the view and the first item will need to be measured to determine the height of the view.
Link copied to clipboard
open fun setCommitPolicy(commitPolicy: Int)
Link copied to clipboard
open fun setSize(width: Int, height: Int)
This should be called when the owner Component's onBoundsDefined is called.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun unbind(view: RecyclerView)
Call this method when the view is unbound.
Link copied to clipboard
open fun unmount(view: RecyclerView)
Call from the owning Component's onUnmount.
Link copied to clipboard
fun updateItemAt(position: Int, component: Component)
fun updateItemAt(position: Int, renderInfo: RenderInfo)
Updates the item at position.
Link copied to clipboard
fun updateItemAtAsync(position: Int, renderInfo: RenderInfo)
Update the item at index position.
Link copied to clipboard
fun updateRangeAt(position: Int, renderInfos: List<RenderInfo>)
Updates the range of items starting at position.
Link copied to clipboard
fun updateRangeAtAsync(position: Int, renderInfos: List<RenderInfo>)
Update the items starting from the given index position.
Link copied to clipboard
open fun updateSubAdapterVisibleRange(firstVisiblePosition: Int, lastVisiblePosition: Int)
Updates the visible range when in sub adapter mode.
Link copied to clipboard
open fun updateSubAdapterWorkingRange(firstVisibleIndex: Int, lastVisibleIndex: Int, firstFullyVisibleIndex: Int, lastFullyVisibleIndex: Int)
Updates the working range when in sub adapter mode.