Skip to content

Commit

Permalink
Merge pull request #46 from 2307vivek/2307vivek-patch-2
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
2307vivek authored Aug 21, 2023
2 parents e5369b0 + 0ee05ba commit bd5f5e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,14 +194,14 @@ Seeker(
### Using different value for thumb
Seeker has the ability to provide a seperate value for the thumb, which makes it possible to move the thumb independent of the progress.
```kotlin
val position by viewModel.position.collectAsState()
var value by remember{ mutableStateOf(0f) }
var thumbPosition by remember{ mutableStateOf(0f) }

val isDragging by interactionSource.collectIsDraggedAsState()

Seeker(
value = value,
thumbValue = if (isDragging) thumbPosition else position,
thumbValue = if (isDragging) thumbPosition else value,
onValueChange = { thumbPosition = it },
onValueChangeFinished = { value = thumbPosition },
readAheadValue = readAheadValue,
Expand Down

0 comments on commit bd5f5e9

Please sign in to comment.