@OnCreateTreeProp static TreePropStringType onCreateTreePropB( ComponentContext c, @Prop TreePropStringType propB) { return propB; }
new PropModel( simpleMethodParamModel, ((Prop) annotation).optional(), ((Prop) annotation).isCommonProp(), ((Prop) annotation).overrideCommonPropBehavior(), ((Prop) annotation).resType(), ((Prop) annotation).varArg());
@OnCreateTreeProp static TreePropNumberType onCreateTreePropA( SectionContext c, @Prop TreePropNumberType propA) { return propA; }
@OnCreateTreeProp static TreePropNumberType onCreateTreePropA( ComponentContext c, @Prop TreePropNumberType propA) { return propA; }
@OnCreateTreeProp static TreePropStringType onCreateTreePropB( SectionContext c, @Prop TreePropStringType propB) { return propB; }
@OnEvent(ClickEvent.class) static void onClickSecondChild(ComponentContext c, @Prop String secondChildString) { Toast.makeText( c.getAndroidContext(), "Second child clicked: " + secondChildString, LENGTH_SHORT) .show(); }
@OnMount static void onMount( ComponentContext c, TransparencyEnabledCardClipDrawable cardClipDrawable, @Prop(optional = true, resType = ResType.COLOR) int cardBackgroundColor, @Prop(optional = true, resType = ResType.DIMEN_OFFSET) float cornerRadius) { cardClipDrawable.setBackgroundColor(cardBackgroundColor); cardClipDrawable.setCornerRadius(cornerRadius); }
@OnEvent(ClickEvent.class) static void onClick( ComponentContext c, @FromEvent View view, @Prop final DemoListActivity.DemoListDataModel model, @Prop final int[] currentIndices) { final Intent intent = new Intent( c.getAndroidContext(), model.datamodels == null ? model.klass : DemoListActivity.class); intent.putExtra(DemoListActivity.INDICES, currentIndices); c.getAndroidContext().startActivity(intent); } }
@OnCreateLayout static Component onCreateLayout( ComponentContext c, @TreeProp TreePropNumberType propA, @TreeProp TreePropStringType propB, @Prop(optional = true) TreePropTestResult resultPropA, @Prop TreePropTestResult resultPropB) { if (resultPropA != null) { resultPropA.mProp = propA; } resultPropB.mProp = propB; return null; } }
@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; }
@OnUnmount static void onUnmount( ComponentContext c, MatrixDrawable convertDrawable, @Prop(resType = ResType.DRAWABLE) Drawable drawable) { convertDrawable.unmount(); }
@OnMeasure protected static void onMeasure( ComponentContext c, ComponentLayout layout, int widthSpec, int heightSpec, Size size, @Prop(optional = true, resType = ResType.FLOAT) float imageAspectRatio) { MeasureUtils.measureWithAspectRatio(widthSpec, heightSpec, imageAspectRatio, size); }
@OnPrepare static void onPrepare( ComponentContext c, @TreeProp TreePropNumberType propA, @Prop TreePropTestResult resultPropA) { resultPropA.mProp = propA; }
@ShouldAlwaysRemeasure protected static boolean shouldAlwaysRemeasure(@Prop Binder<RecyclerView> binder) { return binder.isWrapContent(); }
@OnEvent(OnCheckIsSameItemEvent.class) protected static boolean onCheckIsSameItem( SectionContext c, @FromEvent Object previousItem, @FromEvent Object nextItem, @Prop(optional = true) Comparator isSameItemComparator) { return isSameItemComparator.compare(previousItem, nextItem) == 0; }
@OnEvent(ItemSelectedEvent.class) static void onScrollToPositionSelected( ComponentContext c, @FromEvent String newSelection, @Prop RecyclerCollectionEventsController eventsController) { eventsController.requestScrollToPositionWithSnap(Integer.parseInt(newSelection)); }