-
- All Implemented Interfaces:
-
com.facebook.react.bridge.NativeModule,com.facebook.react.uimanager.BaseViewManagerInterface,com.facebook.react.viewmanagers.SliderManagerInterface
public class ReactSliderManager extends SimpleViewManager<ReactSlider> implements SliderManagerInterface<ReactSlider>
Manages instances of
{@code ReactSlider}.Note that the slider is _not_ a controlled component.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringREACT_CLASS
-
Constructor Summary
Constructors Constructor Description ReactSliderManager()
-
Method Summary
Modifier and Type Method Description StringgetName()LayoutShadowNodecreateShadowNodeInstance()This method should return a subclass of ReactShadowNode which will be then used formeasuring position and size of the view. ClassgetShadowNodeClass()This method should return Class instance that represent type of shadow node that thismanager will return from createShadowNodeInstance. voidsetEnabled(ReactSlider view, boolean enabled)voidsetValue(ReactSlider view, double value)voidsetMinimumValue(ReactSlider view, double value)voidsetMaximumValue(ReactSlider view, double value)voidsetStep(ReactSlider view, double value)voidsetThumbTintColor(ReactSlider view, Integer color)voidsetMinimumTrackTintColor(ReactSlider view, Integer color)voidsetMaximumTrackTintColor(ReactSlider view, Integer color)voidsetDisabled(ReactSlider view, boolean value)voidsetMaximumTrackImage(ReactSlider view, @Nullable() ReadableMap value)voidsetMinimumTrackImage(ReactSlider view, @Nullable() ReadableMap value)voidsetTestID(ReactSlider view, @Nullable() String value)voidsetThumbImage(ReactSlider view, @Nullable() ReadableMap value)voidsetTrackImage(ReactSlider view, @Nullable() ReadableMap value)MapgetExportedCustomDirectEventTypeConstants()Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. Map<String, Object>getExportedCustomBubblingEventTypeConstants()Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. longmeasure(Context context, ReadableMap localData, ReadableMap props, ReadableMap state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, @Nullable() Array<float> attachmentsPositions)Subclasses can override this method to implement custom measure functions for the ViewManager -
Methods inherited from class com.facebook.react.uimanager.SimpleViewManager
getShadowNodeClass, updateExtraData -
Methods inherited from class com.facebook.react.uimanager.BaseViewManager
getExportedCustomDirectEventTypeConstants, setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setMoveShouldSetResponder, setMoveShouldSetResponderCapture, setNativeId, setOpacity, setPointerEnter, setPointerLeave, setPointerMove, setRenderToHardwareTexture, setResponderEnd, setResponderGrant, setResponderMove, setResponderReject, setResponderRelease, setResponderStart, setResponderTerminate, setResponderTerminationRequest, setRotation, setScaleX, setScaleY, setShadowColor, setShouldBlockNativeResponder, setStartShouldSetResponder, setStartShouldSetResponderCapture, setTestId, setTouchCancel, setTouchEnd, setTouchMove, setTouchStart, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex -
Methods inherited from class com.facebook.react.uimanager.ViewManager
createShadowNodeInstance, createShadowNodeInstance, createView, getCommandsMap, getExportedViewConstants, getNativeProps, getShadowNodeClass, measure, onDropViewInstance, receiveCommand, receiveCommand, setPadding, updateExtraData, updateProperties, updateState -
Methods inherited from class com.facebook.react.bridge.BaseJavaModule
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy -
Methods inherited from class com.facebook.react.uimanager.BaseViewManagerInterface
setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setShadowColor, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex -
Methods inherited from class com.facebook.react.viewmanagers.SliderManagerInterface
setDisabled, setEnabled, setMaximumTrackImage, setMaximumTrackTintColor, setMaximumValue, setMinimumTrackImage, setMinimumTrackTintColor, setMinimumValue, setStep, setTestID, setThumbImage, setThumbTintColor, setTrackImage, setValue -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
createShadowNodeInstance
LayoutShadowNode createShadowNodeInstance()
This method should return a subclass of ReactShadowNode which will be then used formeasuring position and size of the view. In most of the cases this should just return aninstance of ReactShadowNode
-
getShadowNodeClass
Class getShadowNodeClass()
This method should return Class instance that represent type of shadow node that thismanager will return from createShadowNodeInstance.
This method will be used in the bridge initialization phase to collect properties exposedusing ReactProp (or ReactPropGroup) annotation from the ReactShadowNode subclass specific for native view this manager provides.
-
setEnabled
void setEnabled(ReactSlider view, boolean enabled)
-
setValue
void setValue(ReactSlider view, double value)
-
setMinimumValue
void setMinimumValue(ReactSlider view, double value)
-
setMaximumValue
void setMaximumValue(ReactSlider view, double value)
-
setStep
void setStep(ReactSlider view, double value)
-
setThumbTintColor
void setThumbTintColor(ReactSlider view, Integer color)
-
setMinimumTrackTintColor
void setMinimumTrackTintColor(ReactSlider view, Integer color)
-
setMaximumTrackTintColor
void setMaximumTrackTintColor(ReactSlider view, Integer color)
-
setDisabled
void setDisabled(ReactSlider view, boolean value)
-
setMaximumTrackImage
void setMaximumTrackImage(ReactSlider view, @Nullable() ReadableMap value)
-
setMinimumTrackImage
void setMinimumTrackImage(ReactSlider view, @Nullable() ReadableMap value)
-
setTestID
void setTestID(ReactSlider view, @Nullable() String value)
-
setThumbImage
void setThumbImage(ReactSlider view, @Nullable() ReadableMap value)
-
setTrackImage
void setTrackImage(ReactSlider view, @Nullable() ReadableMap value)
-
getExportedCustomDirectEventTypeConstants
Map getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return non-bubbling directly-dispatched event types.
Returned map should be of the form:
{ "onTwirl": { "registrationName": "onTwirl" } }
-
getExportedCustomBubblingEventTypeConstants
@Nullable() Map<String, Object> getExportedCustomBubblingEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return bubbling directly-dispatched event types and specify whatnames should be used to subscribe to either form (bubbling/capturing).
Returned map should be of the form:
{ "onTwirl": { "phasedRegistrationNames": { "bubbled": "onTwirl", "captured": "onTwirlCaptured" } } }
-
measure
long measure(Context context, ReadableMap localData, ReadableMap props, ReadableMap state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, @Nullable() Array<float> attachmentsPositions)
Subclasses can override this method to implement custom measure functions for the ViewManager
- Parameters:
context- com.facebook.react.bridge.ReactContext used for the view.localData- ReadableMap containing "local data" defined in C++props- ReadableMap containing JS propsstate- ReadableMap containing state defined in C++width- width of the view (usually zero)widthMode- widthMode used during calculation of layoutheight- height of the view (usually zero)heightMode- widthMode used during calculation of layoutattachmentsPositions- array containing 2x times the amount of attachmentsof the view.
-
-
-
-