@@ -198,11 +198,11 @@ export type AwesomeSliderProps = {
198
198
bubbleContainerStyle ?: StyleProp < ViewStyle > ;
199
199
200
200
/**
201
- * By this, you know the slider status as quickly as possible.(This is useful when you doing video-palyer’ s scrubber.)
201
+ * By this, you know the slider status as quickly as possible.(This is useful when you doing video-player' s scrubber.)
202
202
*/
203
203
isScrubbing ?: Animated . SharedValue < boolean > ;
204
204
/**
205
- * On tap slider event.(This is useful when you doing video-palyer’ s scrubber.)
205
+ * On tap slider event.(This is useful when you doing video-player' s scrubber.)
206
206
*/
207
207
onTap ?: ( ) => void ;
208
208
/**
@@ -319,6 +319,16 @@ export type AwesomeSliderProps = {
319
319
* @default true
320
320
*/
321
321
isRTL ?: boolean ;
322
+
323
+ /**
324
+ * Callback called when the user touches the slider
325
+ */
326
+ onTouchStart ?: ( ) => void ;
327
+
328
+ /**
329
+ * Callback called when the user releases touch from the slider
330
+ */
331
+ onTouchEnd ?: ( ) => void ;
322
332
} ;
323
333
const defaultTheme : SliderThemeType = {
324
334
minimumTrackTintColor : palette . Main ,
@@ -382,6 +392,8 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
382
392
snapThreshold = 0 ,
383
393
snapThresholdMode = 'absolute' ,
384
394
isRTL = I18nManager . isRTL ,
395
+ onTouchStart,
396
+ onTouchEnd,
385
397
} ) {
386
398
const step = propsStep || steps ;
387
399
@@ -755,6 +767,9 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
755
767
isTouchInThumbRange . value =
756
768
Math . abs ( x - thumbPosition . value ) <= thumbTouchSize ;
757
769
}
770
+ if ( onTouchStart ) {
771
+ runOnJS ( onTouchStart ) ( ) ;
772
+ }
758
773
} )
759
774
. onStart ( ( ) => {
760
775
if ( disable ) {
@@ -818,6 +833,11 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
818
833
if ( onSlidingComplete ) {
819
834
runOnJS ( onSlidingComplete ) ( shareValueToSeconds ( ) ) ;
820
835
}
836
+ } )
837
+ . onFinalize ( ( ) => {
838
+ if ( onTouchEnd ) {
839
+ runOnJS ( onTouchEnd ) ( ) ;
840
+ }
821
841
} ) ;
822
842
823
843
if ( activeOffsetX ) {
@@ -866,6 +886,8 @@ export const Slider: FC<AwesomeSliderProps> = memo(function Slider({
866
886
disableTrackPress ,
867
887
isRTL ,
868
888
width ,
889
+ onTouchStart ,
890
+ onTouchEnd ,
869
891
] ) ;
870
892
const onSingleTapEvent = useMemo (
871
893
( ) =>
0 commit comments