|
| 1 | +// Copyright 2004-present Facebook. All Rights Reserved. |
| 2 | + |
| 3 | +package com.facebook.react.fabric; |
| 4 | + |
| 5 | +import com.facebook.react.bridge.ReactApplicationContext; |
| 6 | +import com.facebook.react.bridge.ReactContextBaseJavaModule; |
| 7 | +import com.facebook.react.bridge.ReactMethod; |
| 8 | +import com.facebook.react.bridge.ReadableMap; |
| 9 | +import com.facebook.react.module.annotations.ReactModule; |
| 10 | +import com.facebook.react.uimanager.ReactShadowNode; |
| 11 | + |
| 12 | +/** |
| 13 | + * <p>Native module to allow JS to create and update native Views using Fabric API.</p> |
| 14 | + * |
| 15 | + */ |
| 16 | +@ReactModule(name = FabricUIManagerModule.NAME) |
| 17 | +public class FabricUIManagerModule extends ReactContextBaseJavaModule { |
| 18 | + |
| 19 | + static final String NAME = "FabricUIManager"; |
| 20 | + |
| 21 | + public FabricUIManagerModule(ReactApplicationContext reactContext) { |
| 22 | + super(reactContext); |
| 23 | + } |
| 24 | + |
| 25 | + /** |
| 26 | + * Creates a new {@link ReactShadowNode} |
| 27 | + */ |
| 28 | + @ReactMethod(isBlockingSynchronousMethod = true) |
| 29 | + public int createNode(int reactTag, |
| 30 | + String viewName, |
| 31 | + int rootTag, |
| 32 | + ReadableMap props, |
| 33 | + int instanceHandle) { |
| 34 | + //TODO T25560658 |
| 35 | + return -1; |
| 36 | + } |
| 37 | + |
| 38 | + /** |
| 39 | + * @return a clone of the {@link ReactShadowNode} received by parameter. The cloned |
| 40 | + * ReactShadowNode will contain a copy of all the internal data of the original node, including |
| 41 | + * its children set (note that the children nodes will not be cloned). |
| 42 | + */ |
| 43 | + @ReactMethod(isBlockingSynchronousMethod = true) |
| 44 | + public int cloneNode(int node) { |
| 45 | + //TODO T25560658 |
| 46 | + return -1; |
| 47 | + } |
| 48 | + |
| 49 | + /** |
| 50 | + * @return a clone of the {@link ReactShadowNode} received by parameter. The cloned |
| 51 | + * ReactShadowNode will contain a copy of all the internal data of the original node, but |
| 52 | + * its children set will be empty. |
| 53 | + */ |
| 54 | + @ReactMethod(isBlockingSynchronousMethod = true) |
| 55 | + public int cloneNodeWithNewChildren(int node) { |
| 56 | + //TODO T25560658 |
| 57 | + return -1; |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * @return a clone of the {@link ReactShadowNode} received by parameter. The cloned |
| 62 | + * ReactShadowNode will contain a copy of all the internal data of the original node, but its |
| 63 | + * props will be overridden with the {@link ReadableMap} received by parameter. |
| 64 | + */ |
| 65 | + @ReactMethod(isBlockingSynchronousMethod = true) |
| 66 | + public int cloneNodeWithNewProps(int node, ReadableMap newProps) { |
| 67 | + //TODO T25560658 |
| 68 | + return -1; |
| 69 | + } |
| 70 | + |
| 71 | + /** |
| 72 | + * @return a clone of the {@link ReactShadowNode} received by parameter. The cloned |
| 73 | + * ReactShadowNode will contain a copy of all the internal data of the original node, but its |
| 74 | + * props will be overridden with the {@link ReadableMap} received by parameter and its children |
| 75 | + * set will be empty. |
| 76 | + */ |
| 77 | + @ReactMethod(isBlockingSynchronousMethod = true) |
| 78 | + public int cloneNodeWithNewChildrenAndProps( |
| 79 | + int node, |
| 80 | + ReadableMap newProps) { |
| 81 | + //TODO T25560658 |
| 82 | + return -1; |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Appends the child {@link ReactShadowNode} to the children set of the parent |
| 87 | + * {@link ReactShadowNode}. |
| 88 | + */ |
| 89 | + @ReactMethod |
| 90 | + public void appendChild(int parent, int child) { |
| 91 | + //TODO T25560658 |
| 92 | + } |
| 93 | + |
| 94 | + @ReactMethod(isBlockingSynchronousMethod = true) |
| 95 | + public int createChildSet() { |
| 96 | + //TODO T25560658 |
| 97 | + return -1; |
| 98 | + } |
| 99 | + |
| 100 | + @ReactMethod |
| 101 | + public void appendChildToSet(int childSet, int child) { |
| 102 | + //TODO T25560658 |
| 103 | + } |
| 104 | + |
| 105 | + @ReactMethod |
| 106 | + public void completeRoot(int rootTag, int childSet) { |
| 107 | + //TODO T25560658 |
| 108 | + } |
| 109 | + |
| 110 | + @Override |
| 111 | + public String getName() { |
| 112 | + return NAME; |
| 113 | + } |
| 114 | +} |
0 commit comments