After start/stop API landed we started evaluating graph of nodes in topological order. In order for that to work we needed to create a stack of final node to be evaluated and run it in particular order. What might happen during evaluation is that some new nodes can be marked as updated (e.g. we use set node to update a value in a different nodes subtree). In such a case we want to update views that newly marked node may have impact on.
Here we also changed Android to use ArrayList instead of SparseArray for the list of updated nodes. This is to make it consistent with iOS implementation where we use a regular list too. In practice it won't happen too often that a view is added to a queue several times. Even if that happens, we still will evaluate the node at most once per frame.
I found that Android reanimated code that runs on iOS would often crash because of nodes being used and not registered. This seems to be a quite frequent usecase that some nodes are created and used e.g. in "set" statement but because of the way views are configured they may not be attached to the view hierarchy and hence missing from native registry.
Obj-c handles that case gracefully as all methods can be called on nullable objects. This is not the case in Java, and this PR attempts to mitigate that issue.
This PR adds new "round" and "color" nodes.
Color nodes can be used to map to color props in view (e.g. backgroundColor)
Round is required for the color math to function properly (each color component needs to be an integer).
Added demo app where you can pan view around that changes color depending on the position on HSV palette.