public final class HideableDataDiffSection<T> extends Section
HideableDataDiffSectionSpec
that wraps a DataDiffSectionSpec
.
It provides the ability to remove an item from the DataDiffSection via the
HideItemEvent
.
This Section
emits the following events:
RenderWithHideItemHandlerEvent
whenever it needs a Component
to render a model T from
the list of data. A HideItemEvent
handler is a param of this event.
Providing an handler for this OnEvent
is mandatory.
GetUniqueIdentifierEvent
is fired when a single unique identifier is needed for a
model object.
Modifier and Type | Class and Description |
---|---|
static class |
HideableDataDiffSection.Builder<T> |
SectionLifecycle.StateContainer, SectionLifecycle.StateUpdate
getChildren, getEventDispatcher, getGlobalKey, getScopedContext, getSimpleName, makeShallowCopy, recordEventTrigger, setChildren, setCount, setGlobalKey, setKey, setScopedContext
acceptTriggerEvent, acquireDiff, acquireOutput, bindService, createService, dataBound, dataRendered, dispatchLoadingEvent, generateChangeSet, getEventTrigger, getLoadingEventHandler, getService, getTreePropsForChildren, isDiffSectionSpec, newEventHandler, newEventHandler, newEventTrigger, populateTreeProps, refresh, releaseDiff, releaseOutput, requestFocus, requestFocus, requestFocus, requestFocusWithOffset, requestFocusWithOffset, requestFocusWithOffset, requestSmoothFocus, requestSmoothFocus, requestSmoothFocus, shouldUpdate, transferService, unbindService, viewportChanged
protected SectionLifecycle.StateContainer getStateContainer()
getStateContainer
in class Section
public boolean isEquivalentTo(Section other)
Section
This is used to be able to skip rendering a section again. We avoid using the 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 Section
other
- the component to compare topublic HideableDataDiffSection makeShallowCopy(boolean deepCopy)
makeShallowCopy
in class Section
Section
.
if deepCopy is false the clone won't contain any children or count as it will
be returned in a pre - ChangeSet generation state.public static <T> HideableDataDiffSection.Builder<T> create(SectionContext context)
protected void transferState(SectionContext context, SectionLifecycle.StateContainer _prevStateContainer)
SectionLifecycle
transferState
in class SectionLifecycle
protected static void onBlacklistUpdate(SectionContext c, Object modelObject, EventHandler<GetUniqueIdentifierEvent> getUniqueIdentifierHandlerParam)
protected static void onBlacklistUpdateAsync(SectionContext c, Object modelObject, EventHandler<GetUniqueIdentifierEvent> getUniqueIdentifierHandlerParam)
protected static void onBlacklistUpdateSync(SectionContext c, Object modelObject, EventHandler<GetUniqueIdentifierEvent> getUniqueIdentifierHandlerParam)
public static EventHandler getRenderWithHideItemHandlerEventHandler(SectionContext context)
public static EventHandler getGetUniqueIdentifierEventHandler(SectionContext context)
public static EventHandler<RenderEvent> onRenderEvent(SectionContext c)
public static EventHandler<HideItemEvent> onHideItem(SectionContext c)
public Object dispatchOnEvent(EventHandler eventHandler, Object eventState)
dispatchOnEvent
in interface EventDispatcher
dispatchOnEvent
in class SectionLifecycle
protected void createInitialState(SectionContext c)
createInitialState
in class SectionLifecycle
protected Children createChildren(SectionContext c)
SectionLifecycle
GroupSectionSpec
method annotated with com.facebook.litho.sections.annotations.OnCreateChildren
createChildren
in class SectionLifecycle