ReactPropGroup

annotation class ReactPropGroup

Use this annotation to annotate group of properties of native views that should be exposed to JS. This annotation should only be used for setter methods of subclasses of . It's a batched version of ReactProp annotation (please see documentation of ReactProp for more details about how this annotation can be used).

This annotation is meant to be used for a group of similar properties. That's why it support only a set of properties of the same type. A good example is supporting "border", where we have 7 variations of that property ("borderLeft", "borderHorizontal", etc.) and very similar code for handling each of those.

Each annotated method should return void and take exactly three arguments: first being a view instance to be updated, second should be of type int and will represent index in the group of the property being updated. Last, third argument represent the value that should be set.

Currently only int, float, double and String value types are supported.

In case when property has been removed from the corresponding react component annotated setter will be called and default value will be provided as a value parameter. Default value can be customize using defaultInt or defaultFloat in the case when property is of one of primitive types. In case when String is the property type null value will be provided as a default.

Properties

Link copied to clipboard
val USE_DEFAULT_TYPE: String = "__default_type__"

Functions

Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
Link copied to clipboard
abstract fun customType(): String
Type of property that will be send to JS.
Link copied to clipboard
abstract fun defaultDouble(): Double
Default value for property of type double.
Link copied to clipboard
abstract fun defaultFloat(): Float
Default value for property of type float.
Link copied to clipboard
abstract fun defaultInt(): Int
Default value for property of type int.
Link copied to clipboard
abstract fun defaultLong(): Long
Default value for property of type long.
Link copied to clipboard
abstract fun equals(p: Any): Boolean
Link copied to clipboard
abstract fun hashCode(): Int
Link copied to clipboard
abstract fun names(): Array<String>
Array of names of properties exposed to JS that will be updated using setter method annotated with the given instance of ReactPropGroup annotation
Link copied to clipboard
abstract fun toString(): String