public final class VerticalScroll extends SpecGeneratedComponent
android.widget.ScrollView
. TreeProps will only be set during @OnCreateInitialState
once, so updating TreeProps on the parent will not reflect on the VerticalScroll.
See also: HorizontalScroll
for horizontal scrollability.
com.facebook.litho.widget.VerticalScrollSpec
Modifier and Type | Class and Description |
---|---|
static class |
VerticalScroll.Builder |
SpecGeneratedComponent.TransitionContainer
Component.ContainerBuilder<T extends Component.ContainerBuilder<T>>, Component.MountType, Component.RenderData
Modifier and Type | Method and Description |
---|---|
protected boolean |
canMeasure()
Whether this
Component is able to measure itself according to
specific size constraints. |
boolean |
canPreallocate()
This API informs the framework to fill the content pool for this Mountable ahead of time.
|
protected void |
copyInterStageImpl(InterStagePropsContainer copyIntoInterStagePropsContainer,
InterStagePropsContainer copyFromInterStagePropsContainer) |
static VerticalScroll.Builder |
create(ComponentContext context) |
static VerticalScroll.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected void |
createInitialState(ComponentContext context) |
protected com.facebook.litho.widget.VerticalScroll.VerticalScrollInterStagePropsContainer |
createInterStagePropsContainer() |
protected com.facebook.litho.widget.VerticalScroll.VerticalScrollStateContainer |
createStateContainer() |
Component.MountType |
getMountType()
This indicates the type of the
Object that will be returned by com.facebook.litho.Component#mount . |
boolean |
hasChildLithoViews()
Whether this
Component mounts views that contain component-based
content that can be incrementally mounted e.g. |
protected boolean |
hasState() |
boolean |
implementsShouldUpdate() |
boolean |
isEquivalentProps(Component other,
boolean shouldCompareCommonProps)
Determine if this component has equivalent props to a given component.
|
boolean |
isPureRender() |
VerticalScroll |
makeShallowCopy() |
protected void |
onBoundsDefined(ComponentContext c,
ComponentLayout layout,
InterStagePropsContainer _2)
Called after the layout calculation is finished and the given
ComponentLayout has its
bounds defined. |
protected java.lang.Object |
onCreateMountContent(Context context)
Create the object that will be mounted in the
LithoView . |
protected void |
onMeasure(ComponentContext c,
ComponentLayout layout,
int widthSpec,
int heightSpec,
Size size,
InterStagePropsContainer _5) |
protected void |
onMount(ComponentContext context,
java.lang.Object lithoScrollView,
InterStagePropsContainer _2)
Deploy all UI elements representing the final bounds defined in the given
ComponentLayout . |
protected void |
onUnmount(ComponentContext context,
java.lang.Object lithoScrollView,
InterStagePropsContainer _2)
Unload UI elements associated with this component.
|
int |
poolSize()
This API informs the framework about the size of the content pool.
|
protected boolean |
shouldUpdate(Component _prevAbstractImpl,
StateContainer _prevStateContainer,
Component _nextAbstractImpl,
StateContainer _nextStateContainer)
Whether the component needs updating.
|
protected void |
transferState(StateContainer _prevStateContainer,
StateContainer _nextStateContainer)
|
acceptTriggerEvent, acceptTriggerEventImpl, applyPreviousRenderData, bindDynamicProp, copyPrepareInterStageImpl, createContent, createPoolableContent, createPrepareInterStagePropsContainer, createRecyclingPool, dispatchOnEnteredRange, dispatchOnExitedRange, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getInterStagePropsContainer, getPoolableContentType, getPrepareInterStagePropsContainer, getSimpleName, getSimpleNameDelegate, getTreePropsForChildren, hasAttachDetachCallback, hasOwnErrorHandler, implementsAccessibility, implementsExtraAccessibilityNodes, isMountSizeDependent, isRecyclingDisabled, needsPreviousRenderData, onAttached, onBind, onCreateLayout, onCreateLayoutWithSizeSpec, onCreateMountContentPool, onDetached, onError, onMeasureBaseline, onPrepare, onUnbind, populateTreeProps, prepare, recordEventTrigger, recordRenderData, render, shouldAlwaysRemeasure, usesLocalStateContainer
clone, createMountContent, dispatchErrorEvent, dispatchOnEvent, dispatchOnEventImpl, equals, excludeFromIncrementalMount, getCommonProps, getDynamicProps, getErrorHandler, getEventDispatcher, getEventTrigger, getEventTrigger, getHandle, getTreePropFromParent, getTypeId, hasClickHandlerSet, hashCode, isEqualivalentTreeProps, isEquivalentCommonProps, isEquivalentTo, isEquivalentTo, isLayoutSpecWithSizeSpec, isPureRender, measure, measure, measureMightNotCacheInternalNode, newEventHandler, newEventTrigger, newEventTrigger, onCreateTransition, onLoadStyle, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, registerWorkingRange, resolve, retrieveValue, toString, willRender
protected com.facebook.litho.widget.VerticalScroll.VerticalScrollStateContainer createStateContainer()
createStateContainer
in class SpecGeneratedComponent
protected com.facebook.litho.widget.VerticalScroll.VerticalScrollInterStagePropsContainer createInterStagePropsContainer()
createInterStagePropsContainer
in class SpecGeneratedComponent
public boolean isEquivalentProps(Component other, boolean shouldCompareCommonProps)
Component
isEquivalentProps
in class Component
other
- the component to compare toprotected void copyInterStageImpl(InterStagePropsContainer copyIntoInterStagePropsContainer, InterStagePropsContainer copyFromInterStagePropsContainer)
copyInterStageImpl
in class SpecGeneratedComponent
public VerticalScroll makeShallowCopy()
makeShallowCopy
in class Component
protected void createInitialState(ComponentContext context)
createInitialState
in class SpecGeneratedComponent
protected void onMeasure(ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size size, InterStagePropsContainer _5)
onMeasure
in class SpecGeneratedComponent
protected boolean canMeasure()
Component
Component
is able to measure itself according to
specific size constraints.canMeasure
in class Component
protected void onBoundsDefined(ComponentContext c, ComponentLayout layout, InterStagePropsContainer _2)
SpecGeneratedComponent
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 SpecGeneratedComponent
c
- The Context
used by this component.layout
- The ComponentLayout
with defined position and size.protected java.lang.Object onCreateMountContent(Context context)
Component
LithoView
.onCreateMountContent
in class Component
context
- The Context
to be used to create the content.protected void onMount(ComponentContext context, java.lang.Object lithoScrollView, InterStagePropsContainer _2)
SpecGeneratedComponent
ComponentLayout
. Return either a Drawable
or a View
or null
to be
mounted.onMount
in class SpecGeneratedComponent
context
- The ComponentContext
to mount the component into.protected void onUnmount(ComponentContext context, java.lang.Object lithoScrollView, InterStagePropsContainer _2)
SpecGeneratedComponent
onUnmount
in class SpecGeneratedComponent
context
- The Context
for this mount operation.lithoScrollView
- The Drawable
or View
mounted by this component.protected boolean shouldUpdate(Component _prevAbstractImpl, StateContainer _prevStateContainer, Component _nextAbstractImpl, StateContainer _nextStateContainer)
Component
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 Component
_prevAbstractImpl
- the previous component to compare against._nextAbstractImpl
- the component that is now in use.public boolean implementsShouldUpdate()
implementsShouldUpdate
in class Component
public Component.MountType getMountType()
Component
Object
that will be returned by com.facebook.litho.Component#mount
.getMountType
in class Component
Component.MountType
public int poolSize()
ContentAllocator
Experimental. Currently for Litho team internal use only.
poolSize
in interface ContentAllocator
poolSize
in class SpecGeneratedComponent
public boolean canPreallocate()
ContentAllocator
false
, i.e. content is not pre-allocated. Pre-allocation of the
content can improve performance in some circumstances where creating the content is expensive.canPreallocate
in interface ContentAllocator
canPreallocate
in class SpecGeneratedComponent
public boolean hasChildLithoViews()
Component
Component
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.hasChildLithoViews
in class Component
public boolean isPureRender()
isPureRender
in class Component
protected boolean hasState()
hasState
in class SpecGeneratedComponent
protected void transferState(StateContainer _prevStateContainer, StateContainer _nextStateContainer)
Component
transferState
in class Component
public static VerticalScroll.Builder create(ComponentContext context)
public static VerticalScroll.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)