-
- All Implemented Interfaces:
-
com.google.android.horologist.compose.rotaryinput.RotaryHapticHandler
@Deprecated(message = Replaced by wear compose) public final class DefaultRotaryHapticHandler implements RotaryHapticHandler
Default implementation of RotaryHapticHandler. It handles haptic feedback based on the scrollableState, scrolled pixels and hapticsThresholdPx. Haptic is not fired in this class, instead it's sent to hapticsChannel where it'll performed later.
-
-
Constructor Summary
Constructors Constructor Description DefaultRotaryHapticHandler(ScrollableState scrollableState, Channel<RotaryHapticsType> hapticsChannel, Long hapticsThresholdPx)
-
Method Summary
Modifier and Type Method Description UnithandleScrollHaptic(Float scrollDelta)Handles haptics when scroll is used UnithandleSnapHaptic(Float scrollDelta)Handles haptics when scroll with snap is used -
-
Constructor Detail
-
DefaultRotaryHapticHandler
DefaultRotaryHapticHandler(ScrollableState scrollableState, Channel<RotaryHapticsType> hapticsChannel, Long hapticsThresholdPx)
- Parameters:
scrollableState- Haptic performed based on this statehapticsChannel- Channel to which haptic events will be senthapticsThresholdPx- A scroll threshold after which haptic is produced.
-
-
Method Detail
-
handleScrollHaptic
Unit handleScrollHaptic(Float scrollDelta)
Handles haptics when scroll is used
-
handleSnapHaptic
Unit handleSnapHaptic(Float scrollDelta)
Handles haptics when scroll with snap is used
-
-
-
-