Support animating text color with native driver

Summary:
Typically, ReactTextView#setText is called via ReactTextViewManager#updateExtraData, but natively animated color changes bypass render and layout pass via direct call to SurfaceMountingManager#updateProps from UIManager#synchronouslyUpdateViewOnUIThread.

Thus, for animated color changes to get applied, we need to handle the color prop in ReactTextAnchorViewManager.

In addition, native driver updates are not synchronized with Fabric's mounting; if the native driver update happens before mount, the update is done in updateState.

Changelog:
[Android][Added] - Support animating text color with native driver

Reviewed By: mdvacca

Differential Revision: D34630294

fbshipit-source-id: c0f1e19c801c0e909e84387d623a6556ce6f2d67
This commit is contained in:
Genki Kondo
2022-03-07 15:10:24 -08:00
committed by Facebook GitHub Bot
parent e1dc9a756b
commit 87cdb607e4
3 changed files with 43 additions and 1 deletions
@@ -8,10 +8,12 @@
package com.facebook.react.uimanager;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.react.bridge.Dynamic;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.ReadableType;
import java.util.Map;
/**
@@ -85,11 +87,16 @@ public class ReactStylesDiffMap {
return mBackingMap.getMap(key);
}
@Nullable
@NonNull
public Dynamic getDynamic(String key) {
return mBackingMap.getDynamic(key);
}
@NonNull
public ReadableType getType(String key) {
return mBackingMap.getType(key);
}
@Override
public String toString() {
return "{ " + getClass().getSimpleName() + ": " + mBackingMap.toString() + " }";