Package 

Class DefaultRotaryHapticHandler

  • 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.

    • Method Summary

      Modifier and Type Method Description
      Unit handleScrollHaptic(Float scrollDelta) Handles haptics when scroll is used
      Unit handleSnapHaptic(Float scrollDelta) Handles haptics when scroll with snap is used
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultRotaryHapticHandler

        DefaultRotaryHapticHandler(ScrollableState scrollableState, Channel<RotaryHapticsType> hapticsChannel, Long hapticsThresholdPx)
        Parameters:
        scrollableState - Haptic performed based on this state
        hapticsChannel - Channel to which haptic events will be sent
        hapticsThresholdPx - A scroll threshold after which haptic is produced.