Support colors in AnimatedInterpolation on Android

Summary:
Color support for AnimatedInterpolation was incomplete with native drivers, as only rgba type strings were supported. There was also an issue where color props instead a StyleAnimatedNode would never get applied. We were also potentially duplicating color parsing support, which is already centralized in `normalizeColor` / `processColor`.

Changelog: [Android][Added] Enable AnimatedInterpolation to interpolate arbitrary color types.

Reviewed By: mdvacca

Differential Revision: D40571873

fbshipit-source-id: 41857ab0391279c5307bc31b855ea8fbcb4cccd8
This commit is contained in:
Pieter De Baets authored and Facebook GitHub Bot committed 2022-11-30 10:19:12 -08:00
1 parent b589123a3d
commit e7dbfb2dbd
8 files changed
+242 -99

No files matched your search

@@ -102,7 +102,9 @@ import java.util.Map;
((StyleAnimatedNode) node).collectViewUpdates(mPropMap);
} else if (node instanceof ValueAnimatedNode) {
Object animatedObject = ((ValueAnimatedNode) node).getAnimatedObject();
if (animatedObject instanceof String) {
if (animatedObject instanceof Integer) {
mPropMap.putInt(entry.getKey(), (Integer) animatedObject);
} else if (animatedObject instanceof String) {
mPropMap.putString(entry.getKey(), (String) animatedObject);
} else {
mPropMap.putDouble(entry.getKey(), ((ValueAnimatedNode) node).getValue());