public final class Spinner extends Component
Spinner
Additionally added logic to flip the caret vertically once menu is shown.
If no optional values are provided the component will look like it's material design counterpart.
com.facebook.litho.widget.SpinnerSpec
Modifier and Type | Class and Description |
---|---|
static class |
Spinner.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 |
---|---|
static Spinner.Builder |
create(ComponentContext context) |
static Spinner.Builder |
create(ComponentContext context,
int defStyleAttr,
int defStyleRes) |
protected void |
createInitialState(ComponentContext c) |
Object |
dispatchOnEvent(EventHandler eventHandler,
Object eventState) |
static EventHandler |
getItemSelectedEventHandler(ComponentContext context) |
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.
|
Spinner |
makeShallowCopy() |
static EventHandler<ClickEvent> |
onClick(ComponentContext c) |
protected Component |
onCreateLayout(ComponentContext c)
Generate a tree of
ComponentLayout representing the layout structure of the Component and its sub-components. |
protected void |
transferState(ComponentContext context,
ComponentLifecycle.StateContainer _prevStateContainer)
|
protected static void |
updateIsShowingDropDown(ComponentContext c,
boolean isShowing) |
protected static void |
updateIsShowingDropDownAsync(ComponentContext c,
boolean isShowing) |
protected static void |
updateIsShowingDropDownSync(ComponentContext c,
boolean isShowing) |
protected static void |
updateSelection(ComponentContext c,
String newSelection) |
protected static void |
updateSelectionAsync(ComponentContext c,
String newSelection) |
protected static void |
updateSelectionSync(ComponentContext c,
String newSelection) |
canResolve, clearCachedLayout, copyInterStageImpl, getEventDispatcher, getId, getOrCreateCommonProps, getScopedContext, getSimpleName, measure, recordEventTrigger, registerWorkingRange, releaseCachedLayout, setScopedContext, updateInternalChildState, updateInternalChildState, willRender
acceptTriggerEvent, acquireDiff, acquireOutput, applyPreviousRenderData, callsShouldUpdateOnMount, canMeasure, canMountIncrementally, canPreallocate, createMountContent, dispatchErrorEvent, dispatchErrorEvent, dispatchOnEnteredRange, dispatchOnExitedRange, getEventTrigger, getExtraAccessibilityNodeAt, getExtraAccessibilityNodesCount, getMountType, getTreePropsForChildren, implementsAccessibility, implementsExtraAccessibilityNodes, isMountSizeDependent, isPureRender, needsPreviousRenderData, newEventHandler, newEventHandler, newEventTrigger, onBind, onBoundsDefined, onCreateLayoutWithSizeSpec, onCreateMountContent, onCreateMountContentPool, onCreateTransition, onError, onLoadStyle, onMeasure, onMeasureBaseline, onMount, onPopulateAccessibilityNode, onPopulateExtraAccessibilityNode, onPrepare, onUnbind, onUnmount, poolSize, populateTreeProps, recordRenderData, releaseDiff, releaseOutput, resolve, shouldAlwaysRemeasure, shouldUpdate, 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 topublic Spinner makeShallowCopy()
makeShallowCopy
in class Component
protected void createInitialState(ComponentContext c)
createInitialState
in class ComponentLifecycle
protected Component onCreateLayout(ComponentContext c)
ComponentLifecycle
ComponentLayout
representing the layout structure of the Component
and its sub-components. You should use ComponentContext.newLayoutBuilder(int, int)
to
build the layout tree.onCreateLayout
in class ComponentLifecycle
c
- The ComponentContext
to build a ComponentLayout
tree.public static EventHandler getItemSelectedEventHandler(ComponentContext context)
public static EventHandler<ClickEvent> onClick(ComponentContext c)
public Object dispatchOnEvent(EventHandler eventHandler, Object eventState)
dispatchOnEvent
in interface EventDispatcher
dispatchOnEvent
in class ComponentLifecycle
protected boolean hasState()
hasState
in class ComponentLifecycle
protected void transferState(ComponentContext context, ComponentLifecycle.StateContainer _prevStateContainer)
ComponentLifecycle
transferState
in class ComponentLifecycle
protected static void updateSelection(ComponentContext c, String newSelection)
protected static void updateSelectionAsync(ComponentContext c, String newSelection)
protected static void updateSelectionSync(ComponentContext c, String newSelection)
protected static void updateIsShowingDropDown(ComponentContext c, boolean isShowing)
protected static void updateIsShowingDropDownAsync(ComponentContext c, boolean isShowing)
protected static void updateIsShowingDropDownSync(ComponentContext c, boolean isShowing)
public static Spinner.Builder create(ComponentContext context)
public static Spinner.Builder create(ComponentContext context, int defStyleAttr, int defStyleRes)