public class SwipeRefreshLayoutManager extends ViewGroupManager<ReactSwipeRefreshLayout> implements AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
ReactSwipeRefreshLayout
which allows the user to "pull to refresh" a
child view. Emits an onRefresh
event when this happens.NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REACT_CLASS |
sStateDescription
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
SwipeRefreshLayoutManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEventEmitters(ThemedReactContext reactContext,
ReactSwipeRefreshLayout view)
Subclasses can override this method to install custom event emitters on the given View.
|
protected ReactSwipeRefreshLayout |
createViewInstance(ThemedReactContext reactContext)
Subclasses should return a new View instance of the proper type.
|
protected ViewManagerDelegate<ReactSwipeRefreshLayout> |
getDelegate()
Override this method and return an instance of
ViewManagerDelegate if the props of the
view managed by this view manager should be set via this delegate. |
java.util.Map<java.lang.String,java.lang.Object> |
getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed on
native views.
|
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() |
void |
receiveCommand(ReactSwipeRefreshLayout root,
java.lang.String commandId,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager . |
void |
setColors(ReactSwipeRefreshLayout view,
ReadableArray colors) |
void |
setEnabled(ReactSwipeRefreshLayout view,
boolean enabled) |
void |
setNativeRefreshing(ReactSwipeRefreshLayout view,
boolean value) |
void |
setProgressBackgroundColor(ReactSwipeRefreshLayout view,
java.lang.Integer color) |
void |
setProgressViewOffset(ReactSwipeRefreshLayout view,
float offset) |
void |
setRefreshing(ReactSwipeRefreshLayout view,
boolean refreshing) |
void |
setSize(ReactSwipeRefreshLayout view,
Dynamic size) |
void |
setSize(ReactSwipeRefreshLayout view,
int value) |
addView, addViews, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, getViewZIndex, needsCustomLayoutForChildren, removeAllViews, removeView, removeViewAt, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
onAfterUpdateTransaction, setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex
createShadowNodeInstance, createView, createViewInstance, getCommandsMap, getExportedCustomBubblingEventTypeConstants, getNativeProps, measure, onDropViewInstance, receiveCommand, setPadding, updateLocalData, updateProperties, updateState
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
public static final java.lang.String REACT_CLASS
protected ReactSwipeRefreshLayout createViewInstance(ThemedReactContext reactContext)
ViewManager
createViewInstance
in class ViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
public java.lang.String getName()
getName
in interface NativeModule
getName
in class ViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
public void setEnabled(ReactSwipeRefreshLayout view, boolean enabled)
setEnabled
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
public void setColors(ReactSwipeRefreshLayout view, ReadableArray colors)
setColors
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
public void setProgressBackgroundColor(ReactSwipeRefreshLayout view, java.lang.Integer color)
setProgressBackgroundColor
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
public void setSize(ReactSwipeRefreshLayout view, int value)
setSize
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
public void setSize(ReactSwipeRefreshLayout view, Dynamic size)
public void setRefreshing(ReactSwipeRefreshLayout view, boolean refreshing)
setRefreshing
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
public void setProgressViewOffset(ReactSwipeRefreshLayout view, float offset)
setProgressViewOffset
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
public void setNativeRefreshing(ReactSwipeRefreshLayout view, boolean value)
setNativeRefreshing
in interface AndroidSwipeRefreshLayoutManagerInterface<ReactSwipeRefreshLayout>
protected void addEventEmitters(ThemedReactContext reactContext, ReactSwipeRefreshLayout view)
ViewManager
addEventEmitters
in class ViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
public void receiveCommand(ReactSwipeRefreshLayout root, java.lang.String commandId, ReadableArray args)
ViewManager
UIManager
. Good example of such a command would be scrollTo
request with coordinates
for a ReactScrollView
instance.receiveCommand
in class ViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
root
- View instance that should receive the commandcommandId
- code of the commandargs
- optional arguments for the commandpublic java.util.Map<java.lang.String,java.lang.Object> getExportedViewConstants()
ViewManager
getExportedViewConstants
in class ViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomDirectEventTypeConstants()
ViewManager
Returned map should be of the form:
{ "onTwirl": { "registrationName": "onTwirl" } }
getExportedCustomDirectEventTypeConstants
in class BaseViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
protected ViewManagerDelegate<ReactSwipeRefreshLayout> getDelegate()
ViewManager
ViewManagerDelegate
if the props of the
view managed by this view manager should be set via this delegate. The provided instance will
then get calls to ViewManagerDelegate.setProperty(View, String, Object)
for every prop
that must be updated and it's the delegate's responsibility to apply these values to the view.
By default this method returns null
, which means that the view manager doesn't have
a delegate and the view props should be set internally by the view manager itself.
getDelegate
in class ViewManager<ReactSwipeRefreshLayout,LayoutShadowNode>
ViewManagerDelegate
if the props of the view managed by this
view manager should be set via this delegate