@OnCreateTreeProp static TreePropStringType onCreateTreePropB( ComponentContext c, @Prop TreePropStringType propB) { return propB; }
@OnCreateTreeProp static TreePropNumberType onCreateTreePropA( ComponentContext c, @Prop TreePropNumberType propA) { return propA; }
@OnCreateInitialState static void onCreateInitialState( ComponentContext c, @Prop String selectedOption, StateValue<String> selection) { selection.set(selectedOption); }
@GetExtraAccessibilityNodesCount static int getExtraAccessibilityNodesCount( @Prop(optional = true, resType = ResType.BOOL) boolean accessibleClickableSpans, @FromBoundsDefined ClickableSpan[] clickableSpans) { return (accessibleClickableSpans && clickableSpans != null) ? clickableSpans.length : 0; }
@OnEvent(ClickEvent.class) static void onClick( ComponentContext c, @Prop List<Message> initialMessages, @Param boolean adding) { ExpandableElementRootComponent.onUpdateListSync(c, adding, initialMessages.size()); }
@OnUnmount static void onUnmount( ComponentContext context, HorizontalScrollLithoView mountedView, @Prop(optional = true) HorizontalScrollEventsController eventsController) { mountedView.unmount(); if (eventsController != null) { eventsController.setScrollableView(null); } }
@OnCreateInitialState static void onCreateInitialState( ComponentContext c, StateValue<ScrollPosition> lastScrollPosition, @Prop(optional = true) Integer initialScrollPosition) { lastScrollPosition.set( new ScrollPosition( initialScrollPosition == null ? LAST_SCROLL_POSITION_UNSET : initialScrollPosition)); }
@OnCreateLayout public Component onCreateLayout(ComponentContext c, @Prop String s) { return null; } }
@OnDataBound static void onDataBound( SectionContext c, @Prop int numberOfDummy, @State(canUpdateLazily = true) int extra) { VerySimpleGroupSection.lazyUpdateExtra(c, extra - numberOfDummy); }
@OnEvent(ClickEvent.class) static void onClickLayoutProps( ComponentContext c, @Prop ExamplesLithoLabActivity.LabExampleController labExampleController) { labExampleController.setContentComponent(LearningLayoutPropsComponent.create(c).build()); }
@OnEvent(ClickEvent.class) static void onClickState( ComponentContext c, @Prop ExamplesLithoLabActivity.LabExampleController labExampleController) { labExampleController.setContentComponent(LearningStateComponent.create(c).build()); }
@OnEvent(ClickEvent.class) static void onClickRecyclerBinder( ComponentContext c, @Prop ExamplesLithoLabActivity.LabExampleController labExampleController) { labExampleController.setContentComponent(LearningRecyclerBinderComponent.create(c).build()); } }
@OnEvent(ClickEvent.class) static void onClickClickEvents( ComponentContext c, @Prop ExamplesLithoLabActivity.LabExampleController labExampleController) { labExampleController.setContentComponent( LearningClickEventsComponent.create(c) .secondChildString("Prop passed in from parent.") .build()); }
@OnEvent(Object.class) public void testMethod( @Prop boolean testProp, @State int testState, @Param Object testPermittedAnnotation) { // Don't do anything. }
@OnCreateLayout static Component onCreateLayout(ComponentContext c, @Prop List<ListRow> dataModels) { return RecyclerCollectionComponent.create(c) .disablePTR(true) .section( DataDiffSection.<ListRow>create(new SectionContext(c)) .data(dataModels) .renderEventHandler(ErrorRootComponent.onRender(c)) .build()) .paddingDip(YogaEdge.TOP, 8) .build(); }