Skip to content

Commit

Permalink
revert haptic feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Jun 15, 2024
1 parent e0fddb2 commit 01a6d3a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions seeker/src/commonMain/kotlin/dev/vivvvek/seeker/Seeker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@ import androidx.compose.ui.graphics.drawscope.inset
import androidx.compose.ui.graphics.drawscope.rotateRad
import androidx.compose.ui.graphics.drawscope.translate
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.semantics.disabled
import androidx.compose.ui.semantics.semantics
Expand Down Expand Up @@ -100,7 +98,6 @@ import kotlin.math.atan2
* The first segment must start form the start value of the [range], and all the segments must lie in
* the specified [range], else an [IllegalArgumentException] will be thrown.
* will be thrown.
* @param segmentChangeHapticFeedback enables haptic feedback when the current segment gets updated
* @param enabled whether or not component is enabled and can be interacted with or not
* @param colors [SeekerColors] that will be used to determine the color of the Slider parts in
* different state. See [SeekerDefaults.seekerColors] to customize.
Expand All @@ -124,7 +121,6 @@ fun Seeker(
onValueChange: (Float) -> Unit,
onValueChangeFinished: (() -> Unit)? = null,
segments: List<Segment> = emptyList(),
segmentChangeHapticFeedback: Boolean = false,
enabled: Boolean = true,
colors: SeekerColors = SeekerDefaults.seekerColors(),
dimensions: SeekerDimensions = SeekerDefaults.seekerDimensions(),
Expand Down Expand Up @@ -168,14 +164,6 @@ fun Seeker(
segmentToPxValues(segments, range, widthPx)
}

if (segmentChangeHapticFeedback) {
val haptics = LocalHapticFeedback.current

LaunchedEffect(state.currentSegment) {
haptics.performHapticFeedback(HapticFeedbackType.TextHandleMove)
}
}

LaunchedEffect(thumbValue, segments) {
state.currentSegment(thumbValue, segments)
}
Expand Down

0 comments on commit 01a6d3a

Please sign in to comment.