public class ReactSliderManager extends SimpleViewManager<ReactSlider> implements SliderManagerInterface<ReactSlider>
ReactSlider
.
Note that the slider is _not_ a controlled component.
Modifier and Type | Class and Description |
---|---|
protected static class |
ReactSliderManager.ReactSliderAccessibilityDelegate |
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REACT_CLASS |
protected static ReactSliderManager.ReactSliderAccessibilityDelegate |
sAccessibilityDelegate |
sStateDescription
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
ReactSliderManager() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEventEmitters(ThemedReactContext reactContext,
ReactSlider view)
Subclasses can override this method to install custom event emitters on the given View.
|
LayoutShadowNode |
createShadowNodeInstance()
This method should return a subclass of
ReactShadowNode which will be then used for
measuring position and size of the view. |
protected ReactSlider |
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
|
protected ViewManagerDelegate<ReactSlider> |
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 |
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() |
java.lang.Class |
getShadowNodeClass()
This method should return
Class instance that represent type of shadow node that this
manager will return from ViewManager.createShadowNodeInstance() . |
long |
measure(android.content.Context context,
ReadableMap localData,
ReadableMap props,
ReadableMap state,
float width,
YogaMeasureMode widthMode,
float height,
YogaMeasureMode heightMode,
int[] attachmentsPositions)
Subclasses can override this method to implement custom measure functions for the ViewManager
|
void |
setDisabled(ReactSlider view,
boolean value) |
void |
setEnabled(ReactSlider view,
boolean enabled) |
void |
setMaximumTrackImage(ReactSlider view,
ReadableMap value) |
void |
setMaximumTrackTintColor(ReactSlider view,
java.lang.Integer color) |
void |
setMaximumValue(ReactSlider view,
double value) |
void |
setMinimumTrackImage(ReactSlider view,
ReadableMap value) |
void |
setMinimumTrackTintColor(ReactSlider view,
java.lang.Integer color) |
void |
setMinimumValue(ReactSlider view,
double value) |
void |
setStep(ReactSlider view,
double value) |
void |
setTestID(ReactSlider view,
java.lang.String value) |
void |
setThumbImage(ReactSlider view,
ReadableMap value) |
void |
setThumbTintColor(ReactSlider view,
java.lang.Integer color) |
void |
setTrackImage(ReactSlider view,
ReadableMap value) |
void |
setValue(ReactSlider view,
double value) |
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, getExportedViewConstants, getNativeProps, onDropViewInstance, receiveCommand, receiveCommand, setPadding, updateLocalData, updateProperties, updateState
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
public static final java.lang.String REACT_CLASS
protected static ReactSliderManager.ReactSliderAccessibilityDelegate sAccessibilityDelegate
public java.lang.String getName()
getName
in interface NativeModule
getName
in class ViewManager<ReactSlider,LayoutShadowNode>
public LayoutShadowNode createShadowNodeInstance()
ViewManager
ReactShadowNode
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 ReactShadowNode
createShadowNodeInstance
in class SimpleViewManager<ReactSlider>
public java.lang.Class getShadowNodeClass()
ViewManager
Class
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 SimpleViewManager<ReactSlider>
Class
object that represents type of shadow node used by this view manager.protected ReactSlider createViewInstance(ThemedReactContext context)
ViewManager
createViewInstance
in class ViewManager<ReactSlider,LayoutShadowNode>
public void setEnabled(ReactSlider view, boolean enabled)
setEnabled
in interface SliderManagerInterface<ReactSlider>
public void setValue(ReactSlider view, double value)
setValue
in interface SliderManagerInterface<ReactSlider>
public void setMinimumValue(ReactSlider view, double value)
setMinimumValue
in interface SliderManagerInterface<ReactSlider>
public void setMaximumValue(ReactSlider view, double value)
setMaximumValue
in interface SliderManagerInterface<ReactSlider>
public void setStep(ReactSlider view, double value)
setStep
in interface SliderManagerInterface<ReactSlider>
public void setThumbTintColor(ReactSlider view, java.lang.Integer color)
setThumbTintColor
in interface SliderManagerInterface<ReactSlider>
public void setMinimumTrackTintColor(ReactSlider view, java.lang.Integer color)
setMinimumTrackTintColor
in interface SliderManagerInterface<ReactSlider>
public void setMaximumTrackTintColor(ReactSlider view, java.lang.Integer color)
setMaximumTrackTintColor
in interface SliderManagerInterface<ReactSlider>
public void setDisabled(ReactSlider view, boolean value)
setDisabled
in interface SliderManagerInterface<ReactSlider>
public void setMaximumTrackImage(ReactSlider view, ReadableMap value)
setMaximumTrackImage
in interface SliderManagerInterface<ReactSlider>
public void setMinimumTrackImage(ReactSlider view, ReadableMap value)
setMinimumTrackImage
in interface SliderManagerInterface<ReactSlider>
public void setTestID(ReactSlider view, java.lang.String value)
setTestID
in interface SliderManagerInterface<ReactSlider>
public void setThumbImage(ReactSlider view, ReadableMap value)
setThumbImage
in interface SliderManagerInterface<ReactSlider>
public void setTrackImage(ReactSlider view, ReadableMap value)
setTrackImage
in interface SliderManagerInterface<ReactSlider>
protected void addEventEmitters(ThemedReactContext reactContext, ReactSlider view)
ViewManager
addEventEmitters
in class ViewManager<ReactSlider,LayoutShadowNode>
public java.util.Map getExportedCustomDirectEventTypeConstants()
ViewManager
Returned map should be of the form:
{ "onTwirl": { "registrationName": "onTwirl" } }
getExportedCustomDirectEventTypeConstants
in class BaseViewManager<ReactSlider,LayoutShadowNode>
public long measure(android.content.Context context, ReadableMap localData, ReadableMap props, ReadableMap state, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode, int[] attachmentsPositions)
ViewManager
measure
in class ViewManager<ReactSlider,LayoutShadowNode>
context
- 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
- int[]
array containing 2x times the amount of attachments
of the view. An attachment represents the position of an inline view that needs to be
rendered inside a component and it requires the content of the parent view in order to be
positioned. This array is meant to be used by the platform to RETURN the position of each
attachment, as a result of the calculation of layout. (e.g. this array is used to measure
inlineViews that are rendered inside Text components). On most of the components this array
will be contain a null value.
Even values will represent the TOP of each attachment, Odd values represent the LEFT of each attachment.
protected ViewManagerDelegate<ReactSlider> 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<ReactSlider,LayoutShadowNode>
ViewManagerDelegate
if the props of the view managed by this
view manager should be set via this delegate