alantoa / react-native-awesome-slider

🚀 An anwesome <Slider/> that supports various features haptic, lottie, animation, ballon, etc.
MIT License
263 stars 30 forks source link

Contact surface is too thin when draging on the slider #78

Open NicoKevin opened 1 month ago

NicoKevin commented 1 month ago

I want to make a slider as spotify and that can be easily draggable on phones or other devices but here i tried to increase the touchable area of the slider without increasing the size of the slider itself by using the panHitSlop property but it doesn't increase it as the slider on spotify and others. Do you have an idea ?

This is my component and he is rendered in a view

    <Slider
      theme={{
        maximumTrackTintColor: "#A0A0A0",
        minimumTrackTintColor: "#fff",
      }}
      containerStyle={{ borderRadius: 5, height: 4 }}
      style={styles.slider}
      progress={progress}
      minimumValue={min}
      maximumValue={max}
      onValueChange={onSliderValueChange}
      thumbTintColor="#1DB954"
      panHitSlop={{ top: 20000, bottom: 20000, left: 20000, right: 20000 }}
      renderBubble={() => null} // Return null to avoid rendering the bubble
      setBubbleText={() => {}} // No-op function to avoid setting text in the bubble
    />