Add setChildren to FlatUIImplementation

Summary: Add support in FlatUIImplementation for the setChildren call added in D3235369

Reviewed By: astreet

Differential Revision: D3240883
This commit is contained in:
Dave Miller 2016-04-29 07:20:16 -07:00 committed by Ahmed El-Helw
parent 0d21baf604
commit fede138786
1 changed files with 13 additions and 0 deletions

View File

@ -165,6 +165,19 @@ public class FlatUIImplementation extends UIImplementation {
addChildren(parentNode, addChildTags, addAtIndices);
}
@Override
public void setChildren(
int viewTag,
ReadableArray children) {
ReactShadowNode parentNode = resolveShadowNode(viewTag);
for (int i = 0; i < children.size(); i++) {
ReactShadowNode addToChild = resolveShadowNode(children.getInt(i));
addChildAt(parentNode, addToChild, i, i - 1);
}
}
@Override
public void measure(int reactTag, Callback callback) {
FlatShadowNode node = (FlatShadowNode) resolveShadowNode(reactTag);