public interface Binder<V extends ViewGroup>
Component
and attaching them to a ViewGroup
through the bind(ViewGroup)
method.Modifier and Type | Method and Description |
---|---|
void |
bind(V 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 |
detach()
Detach items under the hood.
|
ComponentTree |
getComponentAt(int position)
Returns the component at the given position in the binder.
|
boolean |
isWrapContent()
Return true if wrap content is enabled, false otherwise.
|
void |
measure(Size outSize,
int widthSpec,
int heightSpec,
EventHandler<ReMeasureEvent> reMeasureEventHandler)
Measure the content of this Binder.
|
void |
mount(V view)
Call this method before the
View is mounted, i.e. |
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 mount(ViewGroup) , bind(ViewGroup) and unmount(ViewGroup) calls. |
void |
setViewportChangedListener(ViewportInfo.ViewportChanged viewportChangedListener)
Bind a
ViewportInfo.ViewportChanged listener to this Binder . |
void |
unbind(V view)
Call this method when the view is unbound.
|
void |
unmount(V view)
Call this method when the view is unmounted.
|
void setSize(int width, int height)
View
that will be passed to the subsequent mount(ViewGroup)
, bind(ViewGroup)
and unmount(ViewGroup)
calls. Can be
called by any thread.width
- Usually the view width minus horizontal padding.height
- Usually the view height minus vertical padding.void measure(Size outSize, int widthSpec, int heightSpec, EventHandler<ReMeasureEvent> reMeasureEventHandler)
ComponentTree getComponentAt(int position)
void mount(V view)
View
is mounted, i.e. within com.facebook.litho.Component#onMount(ComponentContext, Object)
)}void bind(V view)
void unbind(V view)
view
- the view being unbound.void unmount(V view)
view
- the view being unmounted.void setViewportChangedListener(ViewportInfo.ViewportChanged viewportChangedListener)
ViewportInfo.ViewportChanged
listener to this Binder
. The listener will
be notified of Viewport changes.viewportChangedListener
- boolean isWrapContent()
boolean canMeasure()
void setCanMeasure(boolean canMeasure)
void detach()