20 Commits

Author SHA1 Message Date
Michał Osadnik
1ed19e5255 Allow call's input to be a string on Android (#198)
Motivation
On Android, JSCall exception is thrown type if node's value is a string

Changes
Added condition for checking if the type of node is a string and then handle it properly.
2019-04-25 15:02:37 +02:00
Michel dos Santos Kuguio
bb066ed50f update to support gradle >=4.10 (#213) 2019-04-25 10:27:47 +02:00
Krzysztof Magiera
7580879f44 Initial implementation of Transitions 2019-04-04 09:27:15 +02:00
Rokas Augustinas
8fe471d9fd Add more trigonometry operator (#203)
More trigonometry operators.
2019-03-11 11:58:08 +01:00
rmevans9
b9f5bb2a8d Use versions from project configuration if available. (#164)
If a project uses a different sdk for compiling they will run into issues with this project since the versions are hard coded. This applies a change similar to some other libraries to take the versions specified for the project or fallback to the currently hardcoded versions.
2019-01-09 15:12:02 +01:00
Krosh
72b1792df7 Fix build on android (#148)
This commit fix error "Could not resolve all artifacts for configuration ':react-native-reanimated:classpath'". I just up grade version and add google repo
2018-12-12 16:46:35 +01:00
Ely Alvarado
f01a696f3e Update build.gradle to remove compile warning (#120)
With the latest react-native version RN >= 0.57 the android build tools were updated and now using `compile` in the build.gradle file generates the following error:
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
2018-10-22 18:54:53 +02:00
Michał Osadnik
3bbf8a0fed Make Animated Value persist its value after reattaching (#87)
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.
2018-09-28 13:45:51 +02:00
Krzysztof Magiera
f81434dd7f Modernize android build.gradle
Bump buildTools and compileSdk to 25
2018-09-02 21:53:24 +02:00
Michał Osadnik
06b03a8461 Use strings as value (#53) 2018-08-16 17:09:13 +02:00
Michał Osadnik
04719e8537 Move initializing set of visited node outside eval loop on Android (#75) 2018-08-16 16:56:05 +02:00
Michał Osadnik
d54f70ebf6 Update layout props without crossing JS bridge (#45)
* Add handling od iOS and Android

* Fix style

* Delete proder.sh

* Fix example

* staph

* example

* example

* Improve iOS

* Optimize android

* Add whitelist  📎 📊

* Update REAPropsNode.m

* Fix example

* Update App.js

* Update ConfigHelper.js

* Works

* Update REANodesManager.h

* Add files

* Mor pr issues

* Update Android things

* Revert "Update Android things"

This reverts commit 255bb74

* PR

* Update UIManagerUtils.java

* rename

* rename

* Update UIManagerUtils.java

* Update UIManagerUtils.java

* PR

* Pr stuff

* Update UIManagerReanimatedHelper.java

* revert CAC

* Update Android things

(cherry picked from commit 255bb74)

* Update REAPropsNode.m

* Update ConfigHelper.js

* Update NodesManager.java

* js props

* Update REANodesManager.m

* simplify

* dead

* style

* style

* style

* Update Animated.js

* Update UIManagerReanimatedHelper.java

* Update REANodesManager.m
2018-08-14 11:41:30 +02:00
Krzysztof Magiera
438bb676b2 Fix evaluation logic to visit nodes that get marked as updated during eval loop.
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.
2018-08-08 11:23:31 +02:00
Michał Osadnik
01ccea7b3c Add start/stop api (#18)
* Add start api on iOS and struggle to do it on Android 🙌

* Why don't you wanna work 🌝 ?

* Consider crucial

* Well, it might be the issue

* Fix memory leaks

* Make it topological on Android

* Make it topological on iOS as well 🎉

* Change queue to stack

* Style issue

* Names style

* Dummy -> AlwaysEvaluative

* Make it workable for stopping as well

* Add { finished } callback ☑️

* Remove dummy code

* Remane again

* Always

* Remove dummy

* Fix merge issue

* Add zero

* Add delay

* Add readme

* Optimize imports

* Remove unused imports:

* Add tests and fix their consequences

* Styles

* Fix example

* Add sequence, fix delays

* Unused imports

* Unused imports

* Fix tests

* Fix delay

* Change seq system

* Useless stuff

* Useless stuff

* Make it more elegant

* Fix imports

* Fix readme

* Add setValue

* Add parallel

* Fix PR issues

* Fix PR issues

* Fix PR issues

* Fix PR issues

* Fix PR issues

* Simplify delay

* cleanup

* cleanup

* seqq

* pr

* remove delay

* remove delay

* remove delay

* remove delay

* Fix tests

* Fix stop

* Add comment

* rename

* tests wip

* Fix tests

* Fix tests

* wish to make it work some day

* Moar tests

* Remove dummy tests

* Moar js fixes

* android fixed

* ios fixes

* Update rm

* rev tim

* rem deps

* rem imports

* Moarrr testzzz

* line

* Testss

* rmn

* rm empty line

* rnm

* spr

* cmt

* Tests

* style

* sop line

* Fix tests

* Fix test

* fix fix fix

* fix fix fix

* rename

* Fix tests

* simplify

* Add comment

* Add comment

* Add comment

* fixx

* Fix docs

* enter

* fix docs

* fix

* change logic

* mock in all rolling in the tests 🙋

* Fix

* Add one more test

* pos

* current return

* add child

* rename

* rename

* Protocol

* rnm

* Fix tests

* Fix another test

* Fix yet another test

* Rename

* Fix tests

* ``

* detach

* Moar tests

* Fix detaching

* Update REAAlwaysNode.h
2018-08-01 19:00:58 +02:00
Krzysztof Magiera
6cf7234389 Handle empty nodes and convertable types to match iOS impl behavior (#24)
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.
2018-06-08 14:24:09 +02:00
Krzysztof Magiera
46eac7a492 Fix issue with transform config being shared between all nodes (#25) 2018-06-08 09:45:54 +02:00
Krzysztof Magiera
6b19cde018 Add round and color nodes (#15)
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.
2018-06-01 13:51:27 +02:00
Krzysztof Magiera
351640da67 Support JS property updates on Android 2018-04-27 12:31:19 +02:00
Krzysztof Magiera
97e8ddbc94 Use updateContext on iOS and implement updating non-native props 2018-04-25 16:55:34 +02:00
Krzysztof Magiera
cb0a2680a8 Initial commit. 2018-04-25 11:22:32 +02:00