public abstract class ViewGroupManager<T extends android.view.ViewGroup> extends BaseViewManager<T,LayoutShadowNode>
NativeModule.NativeMethodPROP_NATIVE_ID, PROP_TEST_IDMETHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
ViewGroupManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
addView(T parent,
android.view.View child,
int index) |
void |
addViews(T parent,
java.util.List<android.view.View> views)
Convenience method for batching a set of addView calls
Note that this adds the views to the beginning of the ViewGroup
|
LayoutShadowNode |
createShadowNodeInstance()
This method should return a subclass of
ReactShadowNode which will be then used for
measuring position and size of the view. |
android.view.View |
getChildAt(T parent,
int index) |
int |
getChildCount(T parent) |
java.lang.Class<? extends LayoutShadowNode> |
getShadowNodeClass()
This method should return
Class instance that represent type of shadow node that this
manager will return from ViewManager.createShadowNodeInstance(). |
static java.lang.Integer |
getViewZIndex(android.view.View view) |
boolean |
needsCustomLayoutForChildren()
Returns whether this View type needs to handle laying out its own children instead of
deferring to the standard css-layout algorithm.
|
void |
removeAllViews(T parent) |
void |
removeView(T parent,
android.view.View view) |
void |
removeViewAt(T parent,
int index) |
static void |
setViewZIndex(android.view.View view,
int zIndex) |
boolean |
shouldPromoteGrandchildren()
Returns whether or not this View type should promote its grandchildren as Views.
|
void |
updateExtraData(T root,
java.lang.Object extraData)
Subclasses can implement this method to receive an optional extra data enqueued from the
corresponding instance of
ReactShadowNode in
ReactShadowNode.onCollectExtraUpdates(com.facebook.react.uimanager.UIViewOperationQueue). |
setAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setZIndexaddEventEmitters, createShadowNodeInstance, createView, createViewInstance, getCommandsMap, getExportedCustomBubblingEventTypeConstants, getExportedCustomDirectEventTypeConstants, getExportedViewConstants, getName, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, receiveCommand, updatePropertiescanOverrideExistingModule, getConstants, hasConstants, initialize, onCatalystInstanceDestroypublic LayoutShadowNode createShadowNodeInstance()
ViewManagerReactShadowNode which will be then used for
measuring position and size of the view. In most of the cases this should just return an
instance of ReactShadowNodecreateShadowNodeInstance in class ViewManager<T extends android.view.ViewGroup,LayoutShadowNode>public java.lang.Class<? extends LayoutShadowNode> getShadowNodeClass()
ViewManagerClass instance that represent type of shadow node that this
manager will return from ViewManager.createShadowNodeInstance().
This method will be used in the bridge initialization phase to collect properties exposed using
ReactProp (or ReactPropGroup) annotation from the ReactShadowNode
subclass specific for native view this manager provides.getShadowNodeClass in class ViewManager<T extends android.view.ViewGroup,LayoutShadowNode>Class object that represents type of shadow node used by this view manager.public void updateExtraData(T root, java.lang.Object extraData)
ViewManagerReactShadowNode in
ReactShadowNode.onCollectExtraUpdates(com.facebook.react.uimanager.UIViewOperationQueue).
Since css layout step and ui updates can be executed in separate thread apart of setting
x/y/width/height this is the recommended and thread-safe way of passing extra data from css
node to the native view counterpart.
TODO(7247021): Replace updateExtraData with generic update props mechanism after D2086999updateExtraData in class ViewManager<T extends android.view.ViewGroup,LayoutShadowNode>public void addView(T parent, android.view.View child, int index)
public void addViews(T parent, java.util.List<android.view.View> views)
parent - the parent ViewGroupviews - the set of views to addpublic static void setViewZIndex(android.view.View view,
int zIndex)
@Nullable public static java.lang.Integer getViewZIndex(android.view.View view)
public int getChildCount(T parent)
public android.view.View getChildAt(T parent, int index)
public void removeViewAt(T parent, int index)
public void removeView(T parent, android.view.View view)
public void removeAllViews(T parent)
public boolean needsCustomLayoutForChildren()
public boolean shouldPromoteGrandchildren()