public class SectionBinderTarget extends Object implements SectionTree.Target, Binder<RecyclerView>
SectionTree.Target that uses a RecyclerBinder.SectionTree.Target.DynamicConfig| Constructor and Description |
|---|
SectionBinderTarget(RecyclerBinder recyclerBinder) |
SectionBinderTarget(RecyclerBinder recyclerBinder,
boolean useBackgroundChangeSets) |
| Modifier and Type | Method and Description |
|---|---|
void |
bind(RecyclerView view)
Bind this
Binder to a View. |
boolean |
canMeasure()
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.
|
void |
changeConfig(SectionTree.Target.DynamicConfig dynamicConfig)
Notify this target that a new set of configurations is applied.
|
void |
clear() |
void |
delete(int index)
Notify that the
Component at index was deleted. |
void |
deleteRange(int index,
int count) |
void |
detach()
Detach items under the hood.
|
ComponentTree |
getComponentAt(int position)
Returns the component at the given position in the binder.
|
void |
insert(int index,
RenderInfo renderInfo)
Notify that a
Component was added at index. |
void |
insertRange(int index,
int count,
List<RenderInfo> renderInfos) |
boolean |
isWrapContent()
Return true if wrap content is enabled, false otherwise.
|
void |
measure(Size outSize,
int widthSpec,
int heightSpec,
EventHandler<ReMeasureEvent> reMeasureEventEventHandler)
Measure the content of this Binder.
|
void |
mount(RecyclerView view)
Call this method before the
View is mounted, i.e. |
void |
move(int fromPosition,
int toPosition)
Notify that a
Component was moved fromPosition toPosition. |
void |
notifyChangeSetComplete(boolean isDataChanged,
ChangeSetCompleteCallback changeSetCompleteCallback)
Called when a changeset has finished being applied.
|
void |
requestFocus(int index)
Request focus on the item with the given index.
|
void |
requestFocusWithOffset(int index,
int offset)
Request focus on the item with the given index, plus some additional offset.
|
void |
requestSmoothFocus(int index,
int offset,
SmoothScrollAlignmentType type)
Request smooth focus on the item with the given index.
|
void |
setCanMeasure(boolean canMeasure)
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.
|
void |
setSize(int width,
int height)
Set the width and height of the
View that will be passed to the subsequent Binder.mount(ViewGroup), Binder.bind(ViewGroup) and Binder.unmount(ViewGroup) calls. |
void |
setViewportChangedListener(ViewportInfo.ViewportChanged viewportChangedListener)
Bind a
ViewportInfo.ViewportChanged listener to this Binder. |
boolean |
supportsBackgroundChangeSets() |
void |
unbind(RecyclerView view)
Call this method when the view is unbound.
|
void |
unmount(RecyclerView view)
Call this method when the view is unmounted.
|
void |
update(int index,
RenderInfo renderInfo)
Notify that a
Component was updated at index. |
void |
updateRange(int index,
int count,
List<RenderInfo> renderInfos) |
public SectionBinderTarget(RecyclerBinder recyclerBinder)
public SectionBinderTarget(RecyclerBinder recyclerBinder, boolean useBackgroundChangeSets)
public void setSize(int width,
int height)
BinderView that will be passed to the subsequent Binder.mount(ViewGroup), Binder.bind(ViewGroup) and Binder.unmount(ViewGroup) calls. Can be
called by any thread.public void measure(Size outSize, int widthSpec, int heightSpec, EventHandler<ReMeasureEvent> reMeasureEventEventHandler)
Binderpublic ComponentTree getComponentAt(int position)
BindergetComponentAt in interface Binder<RecyclerView>public void mount(RecyclerView view)
BinderView is mounted, i.e. within ComponentLifecycle.onMount(ComponentContext, Object))}public void bind(RecyclerView view)
Binderpublic void unbind(RecyclerView view)
Binderpublic void unmount(RecyclerView view)
Binderpublic void setViewportChangedListener(ViewportInfo.ViewportChanged viewportChangedListener)
BinderViewportInfo.ViewportChanged listener to this Binder. The listener will
be notified of Viewport changes.setViewportChangedListener in interface Binder<RecyclerView>public void insert(int index,
RenderInfo renderInfo)
SectionTree.TargetComponent was added at index.insert in interface SectionTree.Targetpublic void insertRange(int index,
int count,
List<RenderInfo> renderInfos)
insertRange in interface SectionTree.Targetpublic void update(int index,
RenderInfo renderInfo)
SectionTree.TargetComponent was updated at index.update in interface SectionTree.Targetpublic void updateRange(int index,
int count,
List<RenderInfo> renderInfos)
updateRange in interface SectionTree.Targetpublic void move(int fromPosition,
int toPosition)
SectionTree.TargetComponent was moved fromPosition toPosition.move in interface SectionTree.Targetpublic void notifyChangeSetComplete(boolean isDataChanged,
ChangeSetCompleteCallback changeSetCompleteCallback)
SectionTree.TargetnotifyChangeSetComplete in interface SectionTree.Targetpublic void requestFocus(int index)
SectionTree.TargetrequestFocus in interface SectionTree.Targetpublic void requestSmoothFocus(int index,
int offset,
SmoothScrollAlignmentType type)
SectionTree.TargetrequestSmoothFocus in interface SectionTree.Targetpublic void requestFocusWithOffset(int index,
int offset)
SectionTree.TargetrequestFocusWithOffset in interface SectionTree.Targetpublic void delete(int index)
SectionTree.TargetComponent at index was deleted.delete in interface SectionTree.Targetpublic void deleteRange(int index,
int count)
deleteRange in interface SectionTree.Targetpublic boolean isWrapContent()
BinderisWrapContent in interface Binder<RecyclerView>public boolean canMeasure()
BindercanMeasure in interface Binder<RecyclerView>public void setCanMeasure(boolean canMeasure)
BindersetCanMeasure in interface Binder<RecyclerView>public boolean supportsBackgroundChangeSets()
supportsBackgroundChangeSets in interface SectionTree.Targetpublic void changeConfig(SectionTree.Target.DynamicConfig dynamicConfig)
SectionTree.TargetchangeConfig in interface SectionTree.Targetpublic void detach()
Binderpublic void clear()