## Motivation
Issue has been described here https://github.com/kmagiera/react-native-reanimated/issues/182
Using imperative snapTo in `Interactable.View` sometimes didn't lead to any effect.
## Changes
It was caused by a fact that clock was not running and therefore changes haven't been evaluated properly. If GH responsible for dragging hadn't beed activated, clock was not running and then snapping without dragging was expected to run with clock stopped.
Added extra condition for it.
I think it's more natural if animation do not perform so often. Once per second looks better imho and it's a better example of this library usage.
Also, removed animations if "fetch" is finished
## Motivation
I attach example illustrating this issue. The problem appears when we use `evaluateOnce` method (e.g. via `setValue`) for updating node which could be detached in the same time.
## Changes
I observe I haven't deeply understood flow of reanimataed while writing this logic. Actually always node representing evaluation should not have children which has be informed about changes (it's pointless). In fact, always node has to be a child of these nodes, because we want to have these nodes attached (make them not sensitive for other detachments), because they states input for given node.
👋
This morning I tried testing the Examples via Snack, but since it wasn't working I tried to have them work in my local folder... and well, I ended up wanting to test with RN0.57 😅
I didn't have to modify anything about the "main" lib, but I thikn it would be good to -as a separate PR- try to update it too to newer versions of both JS and Native sides.
The changes to the gradle files have been done [following this](https://github.com/ncuillery/rn-diff/compare/rn-0.55.4...rn-0.57.0) comparison map.
I've tested it with both iOS simulator and an Android device and it works fine on both (aside from a crash I'll report separately if I can manage to repro "outside" of the Examples)
When value gets detached from all component it can be still kept in memory and attached to some other component at later time. But because we don't know when JS reference is dropped we need to delete native counterpart of the value when it gets detached. This has led to a situation in which the value was reinstantiated on the native site. In that case if the value has changed we expect it to persist that changes when it gets attached again. This wasn't happening and each time the value was instantiated we'd always use the initial value.
With this change we are solving that issue by querying the value right before we detach the native node and then we use that value to update config such that next time when it gets instantiated it uses updated value instead of the initial one.
## Motivation
I found it pretty fancy to write `nativeEvent` (or some field of `nativeEvent`) as a function which is evaluating on each event's frame.
## Changes
Because it must be done fully natively I do not relate `nativeEvent` function with any View but use list of `AlwaysNodes` instead, which may seems to be similar to `Animated.Code` and behave conceptually in the same way.
On executing code it performs "evalution" which fill required (by function) fields of `nativeEvent` by `Animated.Value`s and connect it to `AlwaysNode`. I decided to use `Proxy` to manage it, but it is not supported currently by Android because of anscient version of JSC, which is going to be replaced soon (kindly ping @pmlocek), so I have done some kind of case-specic polyfill.
merge firstly: https://github.com/kmagiera/react-native-gesture-handler/pull/287
This PR adds an implementation of Interactable.View to examples folder. The implementation is pretty feature full with the exception of alertAreas that I haven't had time yet to work on.
## Motivation
Logic of evaluation was strictly connected with views but it should not be like because some logic could be abstracted from views
## Changes
Add `Animated.Code` which behaves like view, but indeed is not related to any layout.
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.