T - the view handled by this managerpublic abstract class SimpleViewManager<T extends android.view.View> extends BaseViewManager<T,LayoutShadowNode>
ViewManagers. It provides support for most common
properties through extending BaseViewManager. It also reduces boilerplate by specifying
the type of shadow node to be ReactShadowNode and providing default, empty implementation
for some of the methods of ViewManager interface.NativeModule.NativeMethodsStateDescriptionMETHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC| Constructor and Description |
|---|
SimpleViewManager() |
| Modifier and Type | Method and Description |
|---|---|
LayoutShadowNode |
createShadowNodeInstance()
This method should return a subclass of
ReactShadowNode which will be then used for
measuring position and size of the view. |
java.lang.Class<LayoutShadowNode> |
getShadowNodeClass()
This method should return
Class instance that represent type of shadow node that this
manager will return from ViewManager.createShadowNodeInstance(). |
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). |
getExportedCustomDirectEventTypeConstants, onAfterUpdateTransaction, setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setViewStates, setZIndexaddEventEmitters, createShadowNodeInstance, createView, createViewInstance, createViewInstance, getCommandsMap, getDelegate, getExportedCustomBubblingEventTypeConstants, getExportedViewConstants, getName, getNativeProps, measure, onDropViewInstance, receiveCommand, receiveCommand, updateLocalData, updateProperties, updateStatecanOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, 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.View,LayoutShadowNode>public java.lang.Class<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.View,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 T7247021: Replace updateExtraData with generic update props mechanism after D2086999
updateExtraData in class ViewManager<T extends android.view.View,LayoutShadowNode>