Add support for setChildren

Summary: This adds support for UIManager.setChildren on Android like D2757388 added for iOS.

Reviewed By: andreicoman11

Differential Revision: D3235369

fb-gh-sync-id: b538556ec4abdb606f9be26d1b74734046bca0cd
fbshipit-source-id: b538556ec4abdb606f9be26d1b74734046bca0cd
This commit is contained in:
Dave Miller
2016-04-29 04:02:22 -07:00
committed by Facebook Github Bot 1
parent 3f0207d7b5
commit 3a5457cd7c
6 changed files with 136 additions and 29 deletions

View File

@@ -231,6 +231,20 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
removeFrom);
}
/**
* Interface for fast tracking the initial adding of views. Children view tags are assumed to be
* in order
*
* @param viewTag the view tag of the parent view
* @param childrenTags An array of tags to add to the parent in order
*/
@ReactMethod
public void setChildren(
int viewTag,
ReadableArray childrenTags) {
mUIImplementation.setChildren(viewTag, childrenTags);
}
/**
* Replaces the View specified by oldTag with the View specified by newTag within oldTag's parent.
* This resolves to a simple {@link #manageChildren} call, but React doesn't have enough info in