-
Notifications
You must be signed in to change notification settings - Fork 40
Description
` <Slider
progress={progress}
minimumValue={min}
maximumValue={max}
containerStyle={{
height: 7,
borderRadius: 16,
}}
thumbWidth={10}
renderBubble={() => null}
theme={{
minimumTrackTintColor: '#03C75A',
maximumTrackTintColor: '#D9D9D9',
}}
onSlidingStart={() => (isSliding.value = true)}
onValueChange={async (value) => {
await TrackPlayer.seekTo(value * duration)
}}
renderTrack={() => (
<Animated.View
style={{
width: '100%',
height: '100%',
position: 'absolute',
left: 0,
top: 0,
bottom: 0,
borderRadius: 16,
overflow: 'hidden',
}}
>
<LinearGradient
start={{ x: 0, y: 0 }}
end={{ x: 1, y: 0 }}
colors={['#FF0000', '#00FF00', '#0000FF']}
style={StyleSheet.absoluteFill}
/>
</Animated.View>
)}
onSlidingComplete={async (value) => {
if (!isSliding.value) return
isSliding.value = false
await TrackPlayer.seekTo(value * duration)
}}
/>`
I wanted to add a gradient, but renderTrack doesn't work.