public final class VerticalScroll extends Component
ScrollView
.
See also: HorizontalScroll
for horizontal scrollability.
com.facebook.litho.widget.VerticalScrollSpec
Modifier and Type | Class and Description |
---|---|
static class |
VerticalScroll.Builder |
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>
ComponentLifecycle.MountType, ComponentLifecycle.RenderData, ComponentLifecycle.StateContainer, ComponentLifecycle.StateUpdate, ComponentLifecycle.TransitionContainer
mSplitChildrenLayoutInThreadPool
Modifier and Type | Method and Description |
---|---|
boolean |
callsShouldUpdateOnMount() |
protected boolean |
canMeasure()
Whether this
ComponentLifecycle is able to measure itself according
to specific size constraints. |
boolean |
canMountIncrementally()
Whether this
ComponentLifecycle mounts views that contain component-based
content that can be incrementally mounted e.g. |
protected boolean |
canPreallocate() |
protected void |
copyInterStageImpl(Component component) |
static VerticalScroll.Builder |
create(ComponentContext context) |
static VerticalScroll.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected void |
createInitialState(ComponentContext context) |
ComponentLifecycle.MountType |
getMountType()
This indicates the type of the
Object that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object) . |
protected ComponentLifecycle.StateContainer |
getStateContainer() |
protected boolean |
hasState() |
boolean |
isEquivalentTo(Component other)
Compares this component to a different one to check if they are the same
This is used to be able to skip rendering a component again.
|
protected boolean |
isMountSizeDependent() |
boolean |
isPureRender() |
VerticalScroll |
makeShallowCopy() |
protected void |
onBoundsDefined(ComponentContext c,
ComponentLayout layout)
Called after the layout calculation is finished and the given
ComponentLayout has its
bounds defined. |
protected Object |
onCreateMountContent(Context context)
Create the object that will be mounted in the
LithoView . |
protected void |
onMeasure(ComponentContext context,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size) |
protected void |
onMount(ComponentContext context,
Object lithoScrollView)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout . |
protected void |
onUnmount(ComponentContext context,
Object lithoScrollView)
Unload UI elements associated with this component.
|
protected int |
poolSize() |
protected boolean |
shouldUpdate(Component _prevAbstractImpl,
Component _nextAbstractImpl)
Whether the component needs updating.
|
protected void |
transferState(ComponentContext context,
ComponentLifecycle.StateContainer _prevStateContainer)
|
canResolve, clearCachedLayout, getEventDispatcher, getId, getOrCreateCommonProps, getScopedContext, getSimpleName, measure, recordEventTrigger, registerWorkingRange, releaseCachedLayout, setScopedContext, updateInternalChildState, updateInternalChildState, willRender
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnEvent, dispatchOnExitedRange, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getTreePropsForChildren, implementsAccessibility, implementsExtraAccessibilityNodes, needsPreviousRenderData, newEventHandler, newEventHandler, newEventTrigger, onBind, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onCreateTransition, onError, onLoadStyle, onMeasureBaseline, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onUnbind, populateTreeProps, recordRenderData, releaseDiff, releaseOutput, resolve, shouldAlwaysRemeasure, shouldUseDisplayList
protected ComponentLifecycle.StateContainer getStateContainer()
getStateContainer
in class Component
public boolean isEquivalentTo(Component other)
Component
Object.equals(Object)
so we can optimize the code better over time since we don't have
to adhere to the contract required for a equals method.isEquivalentTo
in class Component
other
- the component to compare toprotected void copyInterStageImpl(Component component)
copyInterStageImpl
in class Component
public VerticalScroll makeShallowCopy()
makeShallowCopy
in class Component
protected void createInitialState(ComponentContext context)
createInitialState
in class ComponentLifecycle
protected void onMeasure(ComponentContext context, ComponentLayout layout, int widthSpec, int heightSpec, Size size)
onMeasure
in class ComponentLifecycle
protected boolean canMeasure()
ComponentLifecycle
ComponentLifecycle
is able to measure itself according
to specific size constraints.canMeasure
in class ComponentLifecycle
protected void onBoundsDefined(ComponentContext c, ComponentLayout layout)
ComponentLifecycle
ComponentLayout
has its
bounds defined. You can use ComponentLayout.getX()
, ComponentLayout.getY()
,
ComponentLayout.getWidth()
, and ComponentLayout.getHeight()
to get the size and
position of the component in the layout tree.onBoundsDefined
in class ComponentLifecycle
c
- The Context
used by this component.layout
- The ComponentLayout
with defined position and size.protected Object onCreateMountContent(Context context)
ComponentLifecycle
LithoView
.onCreateMountContent
in class ComponentLifecycle
context
- The Context
to be used to create the content.protected void onMount(ComponentContext context, Object lithoScrollView)
ComponentLifecycle
ComponentLayout
. Return either a Drawable
or a View
or null
to be
mounted.onMount
in class ComponentLifecycle
context
- The ComponentContext
to mount the component into.protected void onUnmount(ComponentContext context, Object lithoScrollView)
ComponentLifecycle
onUnmount
in class ComponentLifecycle
context
- The Context
for this mount operation.lithoScrollView
- The Drawable
or View
mounted by this component.protected boolean shouldUpdate(Component _prevAbstractImpl, Component _nextAbstractImpl)
ComponentLifecycle
For layout components, the framework will verify that none of the children of the component need updating, and that both components have the same number of children. Therefore this method just needs to determine any changes to the top-level component that would cause it to need to be updated (for example, a click handler was added).
For mount specs, the framework does nothing extra and this method alone determines whether the component is updated or not.
shouldUpdate
in class ComponentLifecycle
_prevAbstractImpl
- the previous component to compare against._nextAbstractImpl
- the component that is now in use.public ComponentLifecycle.MountType getMountType()
ComponentLifecycle
Object
that will be returned by ComponentLifecycle.mount(com.facebook.litho.ComponentContext, java.lang.Object)
.getMountType
in class ComponentLifecycle
ComponentLifecycle.MountType
protected int poolSize()
poolSize
in class ComponentLifecycle
protected boolean canPreallocate()
canPreallocate
in class ComponentLifecycle
public boolean canMountIncrementally()
ComponentLifecycle
ComponentLifecycle
mounts views that contain component-based
content that can be incrementally mounted e.g. if the mounted view has a
LithoView with incremental mount enabled.canMountIncrementally
in class ComponentLifecycle
protected boolean isMountSizeDependent()
isMountSizeDependent
in class ComponentLifecycle
public boolean callsShouldUpdateOnMount()
callsShouldUpdateOnMount
in class ComponentLifecycle
public boolean isPureRender()
isPureRender
in class ComponentLifecycle
protected boolean hasState()
hasState
in class ComponentLifecycle
protected void transferState(ComponentContext context, ComponentLifecycle.StateContainer _prevStateContainer)
ComponentLifecycle
transferState
in class ComponentLifecycle
public static VerticalScroll.Builder create(ComponentContext context)
public static VerticalScroll.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)