@OnEvent(ClickEvent.class) static void onClickAbsoluteChild(ComponentContext c, @Param String absoluteParam) { Toast.makeText(c.getAndroidContext(), "Absolute child clicked: " + absoluteParam, LENGTH_SHORT) .show(); } }
@OnUpdateState static void updateError(StateValue<Optional<String>> error, @Param String errorMsg) { error.set(Optional.of(errorMsg)); }
@OnUpdateState static void updateIsShowingDropDown( StateValue<Boolean> isShowingDropDown, @Param boolean isShowing) { isShowingDropDown.set(isShowing); }
@OnUpdateState static void updateExpandedState(StateValue<Boolean> expanded, @Param boolean expand) { expanded.set(expand); }
@OnUpdateState static void onUpdateState( StateValue<Integer> extra, @Param int newExtra) { extra.set(newExtra); }
@OnUpdateState protected static void onUpdateMeasure(@Param int measureVer, StateValue<Integer> measureVersion) { // We don't really need to update a state here. This state update is only really used to force // a re-layout on the tree containing this Recycler. measureVersion.set(measureVer); }
@OnEvent(ClickEvent.class) static void onClick( ComponentContext c, @Prop List<Message> initialMessages, @Param boolean adding) { ExpandableElementRootComponent.onUpdateListSync(c, adding, initialMessages.size()); }
@OnEvent(ClickEvent.class) static void onClick( ComponentContext c, @Prop RecyclerCollectionEventsController eventsController, @Param boolean forward) { if (forward) { eventsController.requestScrollToNextPosition(true); } else { eventsController.requestScrollToPreviousPosition(true); } } }
@OnEvent(RenderEvent.class) protected static RenderInfo onRender( SectionContext c, @FromEvent Object model, @Param ComponentContext context) { return ComponentRenderInfo.create() .customAttribute("model", model) .component(Text.create(context).text(model.toString()).build()) .build(); }
@OnEvent(Object.class) public void testMethod( @Prop boolean testProp, @State int testState, @Param Object testPermittedAnnotation) { // Don't do anything. }
@OnUpdateState public void testMethod( @Prop boolean testProp, @State int testState, @Param Object testPermittedAnnotation) { // Don't do anything. } }
@OnEvent(Object.class) public void testEventMethod( @Prop boolean arg0, @Prop @Nullable Component arg4, @State int arg1, @Param Object arg2, @TreeProp long arg3) {}
@OnTrigger(TestEvent.class) public void testMethod( @Prop boolean testProp, @State int testState, @Param Object testPermittedAnnotation, @FromTrigger long arg4) { // Don't do anything. }
@OnCreateLayout public void onCreateLayout( @Prop boolean arg0, @State int arg1, @Param Object arg2, @TreeProp long arg3, @State(canUpdateLazily = true) boolean arg4) {}
@OnCreateLayout public void onCreateLayout( @Prop boolean arg0, @State int arg1, @Param Object arg2, @TreeProp long arg3, @State(canUpdateLazily = true) boolean arg4) {}
@OnCreateLayout public void onCreateLayout( @Prop boolean arg0, @State int arg1, @Param Object arg2, @TreeProp long arg3, @State(canUpdateLazily = true) boolean arg4) {}
@OnCreateLayout public void testDelegateMethod( @Prop boolean arg0, @State int arg1, @Param Object arg2, @TreeProp long arg3, @Prop @Nullable Component arg4, @Prop List<Component> arg5, @Prop List<String> arg6, @TreeProp Set<List<Row>> arg7, @TreeProp Set<Integer> arg8) {}
@OnCreateLayout public void testDelegateMethod( @Prop boolean arg0, @Prop Section section, @State int arg1, @Param Object arg2, @Prop(optional = true) boolean arg3, @Prop(varArg = "name") List<String> names, @Prop(optional = true) float arg5) {}