public class SectionBinderTarget extends java.lang.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,
java.util.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 |
requestFocusWithOffset(java.lang.Object id,
int offset)
Request focus on the item with the given id, plus some additional offset.
|
void |
requestSmoothFocus(int index,
int offset,
SmoothScrollAlignmentType type)
Request smooth focus on the item with the given index.
|
void |
requestSmoothFocus(java.lang.Object id,
int offset,
SmoothScrollAlignmentType type)
Request smooth focus on the item with the given Handle.
|
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,
java.util.List<RenderInfo> renderInfos) |
public SectionBinderTarget(RecyclerBinder recyclerBinder)
public SectionBinderTarget(RecyclerBinder recyclerBinder, boolean useBackgroundChangeSets)
public void setSize(int width, int height)
Binder
View
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)
Binder
public ComponentTree getComponentAt(int position)
Binder
getComponentAt
in interface Binder<RecyclerView>
public void mount(RecyclerView view)
Binder
View
is mounted, i.e. within com.facebook.litho.Component#onMount(ComponentContext, Object)
)}public void bind(RecyclerView view)
Binder
public void unbind(RecyclerView view)
Binder
public void unmount(RecyclerView view)
Binder
public void setViewportChangedListener(ViewportInfo.ViewportChanged viewportChangedListener)
Binder
ViewportInfo.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.Target
Component
was added at index.insert
in interface SectionTree.Target
public void insertRange(int index, int count, java.util.List<RenderInfo> renderInfos)
insertRange
in interface SectionTree.Target
public void update(int index, RenderInfo renderInfo)
SectionTree.Target
Component
was updated at index.update
in interface SectionTree.Target
public void updateRange(int index, int count, java.util.List<RenderInfo> renderInfos)
updateRange
in interface SectionTree.Target
public void move(int fromPosition, int toPosition)
SectionTree.Target
Component
was moved fromPosition toPosition.move
in interface SectionTree.Target
public void notifyChangeSetComplete(boolean isDataChanged, ChangeSetCompleteCallback changeSetCompleteCallback)
SectionTree.Target
notifyChangeSetComplete
in interface SectionTree.Target
public void requestFocus(int index)
SectionTree.Target
requestFocus
in interface SectionTree.Target
public void requestSmoothFocus(int index, int offset, SmoothScrollAlignmentType type)
SectionTree.Target
requestSmoothFocus
in interface SectionTree.Target
public void requestFocusWithOffset(int index, int offset)
SectionTree.Target
requestFocusWithOffset
in interface SectionTree.Target
public void requestSmoothFocus(java.lang.Object id, int offset, SmoothScrollAlignmentType type)
SectionTree.Target
requestSmoothFocus
in interface SectionTree.Target
public void requestFocusWithOffset(java.lang.Object id, int offset)
SectionTree.Target
requestFocusWithOffset
in interface SectionTree.Target
public void delete(int index)
SectionTree.Target
Component
at index was deleted.delete
in interface SectionTree.Target
public void deleteRange(int index, int count)
deleteRange
in interface SectionTree.Target
public boolean isWrapContent()
Binder
isWrapContent
in interface Binder<RecyclerView>
public boolean canMeasure()
Binder
canMeasure
in interface Binder<RecyclerView>
public void setCanMeasure(boolean canMeasure)
Binder
setCanMeasure
in interface Binder<RecyclerView>
public boolean supportsBackgroundChangeSets()
supportsBackgroundChangeSets
in interface SectionTree.Target
public void changeConfig(SectionTree.Target.DynamicConfig dynamicConfig)
SectionTree.Target
changeConfig
in interface SectionTree.Target
public void detach()
Binder
public void clear()