public class ReactViewPagerManager extends ViewGroupManager<ReactViewPager>
ViewManager
that provides native ViewPager
view.NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND_SET_PAGE |
static int |
COMMAND_SET_PAGE_WITHOUT_ANIMATION |
static java.lang.String |
REACT_CLASS |
sStateDescription
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
ReactViewPagerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addView(ReactViewPager parent,
android.view.View child,
int index) |
protected ReactViewPager |
createViewInstance(ThemedReactContext reactContext)
Subclasses should return a new View instance of the proper type.
|
android.view.View |
getChildAt(ReactViewPager parent,
int index) |
int |
getChildCount(ReactViewPager parent) |
java.util.Map<java.lang.String,java.lang.Integer> |
getCommandsMap()
Subclasses of
ViewManager that expect to receive commands through UIManagerModule.dispatchViewManagerCommand(int, com.facebook.react.bridge.Dynamic, 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 |
getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed on
native views.
|
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(ReactViewPager viewPager,
int commandType,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager . |
void |
receiveCommand(ReactViewPager viewPager,
java.lang.String commandType,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager . |
void |
removeViewAt(ReactViewPager parent,
int index) |
void |
setPageMargin(ReactViewPager pager,
float margin) |
void |
setPeekEnabled(ReactViewPager pager,
boolean peekEnabled) |
void |
setScrollEnabled(ReactViewPager viewPager,
boolean value) |
addViews, createShadowNodeInstance, getShadowNodeClass, getViewZIndex, removeAllViews, removeView, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
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, setZIndex
addEventEmitters, createShadowNodeInstance, createView, createViewInstance, getDelegate, getExportedCustomBubblingEventTypeConstants, getExportedViewConstants, getNativeProps, measure, onDropViewInstance, updateLocalData, updateProperties, updateState
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
public static final java.lang.String REACT_CLASS
public static final int COMMAND_SET_PAGE
public static final int COMMAND_SET_PAGE_WITHOUT_ANIMATION
public java.lang.String getName()
getName
in interface NativeModule
getName
in class ViewManager<ReactViewPager,LayoutShadowNode>
protected ReactViewPager createViewInstance(ThemedReactContext reactContext)
ViewManager
createViewInstance
in class ViewManager<ReactViewPager,LayoutShadowNode>
public void setScrollEnabled(ReactViewPager viewPager, boolean value)
public boolean needsCustomLayoutForChildren()
ViewGroupManager
needsCustomLayoutForChildren
in interface IViewManagerWithChildren
needsCustomLayoutForChildren
in class ViewGroupManager<ReactViewPager>
public java.util.Map getExportedCustomDirectEventTypeConstants()
ViewManager
Returned map should be of the form:
{ "onTwirl": { "registrationName": "onTwirl" } }
getExportedCustomDirectEventTypeConstants
in class BaseViewManager<ReactViewPager,LayoutShadowNode>
public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManager
ViewManager
that expect to receive commands through UIManagerModule.dispatchViewManagerCommand(int, com.facebook.react.bridge.Dynamic, 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
.getCommandsMap
in class ViewManager<ReactViewPager,LayoutShadowNode>
public void receiveCommand(ReactViewPager viewPager, int commandType, ReadableArray args)
ViewManager
UIManager
. Good example of such a command would be scrollTo
request with coordinates
for a ScrollView
instance.
This method is deprecated use ViewManager.receiveCommand(View, String, ReadableArray)
instead.
receiveCommand
in class ViewManager<ReactViewPager,LayoutShadowNode>
viewPager
- View instance that should receive the commandcommandType
- code of the commandargs
- optional arguments for the commandpublic void receiveCommand(ReactViewPager viewPager, java.lang.String commandType, ReadableArray args)
ViewManager
UIManager
. Good example of such a command would be scrollTo
request with coordinates
for a ReactScrollView
instance.receiveCommand
in class ViewManager<ReactViewPager,LayoutShadowNode>
viewPager
- View instance that should receive the commandcommandType
- code of the commandargs
- optional arguments for the commandpublic void addView(ReactViewPager parent, android.view.View child, int index)
addView
in class ViewGroupManager<ReactViewPager>
public int getChildCount(ReactViewPager parent)
getChildCount
in class ViewGroupManager<ReactViewPager>
public android.view.View getChildAt(ReactViewPager parent, int index)
getChildAt
in class ViewGroupManager<ReactViewPager>
public void removeViewAt(ReactViewPager parent, int index)
removeViewAt
in class ViewGroupManager<ReactViewPager>
public void setPageMargin(ReactViewPager pager, float margin)
public void setPeekEnabled(ReactViewPager pager, boolean peekEnabled)