public class ReactToolbarManager extends ViewGroupManager<ReactToolbar>
NativeModule.NativeMethod
PROP_NATIVE_ID, PROP_TEST_ID
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
ReactToolbarManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEventEmitters(ThemedReactContext reactContext,
ReactToolbar view)
Subclasses can override this method to install custom event emitters on the given View.
|
protected ReactToolbar |
createViewInstance(ThemedReactContext reactContext)
Subclasses should return a new View instance of the proper type.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getCommandsMap()
Subclasses of
ViewManager that expect to receive commands through
UIManagerModule.dispatchViewManagerCommand(int, int, com.facebook.react.bridge.ReadableArray) should override this method returning the
map between names of the commands and IDs that are then used in ViewManager.receiveCommand(T, int, com.facebook.react.bridge.ReadableArray) method
whenever the command is dispatched for this particular ViewManager . |
java.util.Map<java.lang.String,java.lang.Object> |
getExportedViewConstants()
Returns a map of view-specific constants that are injected to JavaScript.
|
java.lang.String |
getName() |
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 |
receiveCommand(ReactToolbar view,
int commandType,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager . |
void |
setActions(ReactToolbar view,
ReadableArray actions) |
void |
setContentInsetEnd(ReactToolbar view,
float insetEnd) |
void |
setContentInsetStart(ReactToolbar view,
float insetStart) |
void |
setLogo(ReactToolbar view,
ReadableMap logo) |
void |
setNavIcon(ReactToolbar view,
ReadableMap navIcon) |
void |
setOverflowIcon(ReactToolbar view,
ReadableMap overflowIcon) |
void |
setRtl(ReactToolbar view,
boolean rtl) |
void |
setSubtitle(ReactToolbar view,
java.lang.String subtitle) |
void |
setSubtitleColor(ReactToolbar view,
java.lang.Integer subtitleColor) |
void |
setTitle(ReactToolbar view,
java.lang.String title) |
void |
setTitleColor(ReactToolbar view,
java.lang.Integer titleColor) |
addView, addViews, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, getViewZIndex, removeAllViews, removeView, removeViewAt, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
setAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setZIndex
createShadowNodeInstance, createView, getExportedCustomBubblingEventTypeConstants, getExportedCustomDirectEventTypeConstants, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, updateProperties
canOverrideExistingModule, getConstants, hasConstants, initialize, onCatalystInstanceDestroy
public java.lang.String getName()
getName
in interface NativeModule
getName
in class ViewManager<ReactToolbar,LayoutShadowNode>
protected ReactToolbar createViewInstance(ThemedReactContext reactContext)
ViewManager
createViewInstance
in class ViewManager<ReactToolbar,LayoutShadowNode>
public void setLogo(ReactToolbar view, @Nullable ReadableMap logo)
public void setNavIcon(ReactToolbar view, @Nullable ReadableMap navIcon)
public void setOverflowIcon(ReactToolbar view, @Nullable ReadableMap overflowIcon)
public void setRtl(ReactToolbar view, boolean rtl)
public void setSubtitle(ReactToolbar view, @Nullable java.lang.String subtitle)
public void setSubtitleColor(ReactToolbar view, @Nullable java.lang.Integer subtitleColor)
public void setTitle(ReactToolbar view, @Nullable java.lang.String title)
public void setTitleColor(ReactToolbar view, @Nullable java.lang.Integer titleColor)
public void setContentInsetStart(ReactToolbar view, float insetStart)
public void setContentInsetEnd(ReactToolbar view, float insetEnd)
public void setActions(ReactToolbar view, @Nullable ReadableArray actions)
protected void addEventEmitters(ThemedReactContext reactContext, ReactToolbar view)
ViewManager
addEventEmitters
in class ViewManager<ReactToolbar,LayoutShadowNode>
@Nullable public java.util.Map<java.lang.String,java.lang.Object> getExportedViewConstants()
ViewManager
getExportedViewConstants
in class ViewManager<ReactToolbar,LayoutShadowNode>
public boolean needsCustomLayoutForChildren()
ViewGroupManager
needsCustomLayoutForChildren
in class ViewGroupManager<ReactToolbar>
@Nullable public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManager
ViewManager
that expect to receive commands through
UIManagerModule.dispatchViewManagerCommand(int, int, com.facebook.react.bridge.ReadableArray)
should override this method returning the
map between names of the commands and IDs that are then used in ViewManager.receiveCommand(T, int, com.facebook.react.bridge.ReadableArray)
method
whenever the command is dispatched for this particular ViewManager
.
As an example we may consider ReactWebViewManager
that expose the following commands:
goBack, goForward, reload. In this case the map returned from ViewManager.getCommandsMap()
from
ReactWebViewManager
will look as follows:
{
"goBack": 1,
"goForward": 2,
"reload": 3,
}
Now assuming that "reload" command is dispatched through UIManagerModule
we trigger
ReactWebViewManager#receiveCommand
passing "3" as commandId
argument.getCommandsMap
in class ViewManager<ReactToolbar,LayoutShadowNode>
public void receiveCommand(ReactToolbar view, int commandType, @Nullable ReadableArray args)
ViewManager
UIManager
. Good example of such a command would be scrollTo
request with
coordinates for a ScrollView
or goBack
request for a WebView
instance.receiveCommand
in class ViewManager<ReactToolbar,LayoutShadowNode>
view
- View instance that should receive the commandcommandType
- code of the commandargs
- optional arguments for the command