ShakeDetector

Detects shake gestures using the device's accelerometer. Triggers when device acceleration exceeds threshold twice within 500ms. Includes a 1-second debounce to prevent multiple fires.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun onAccuracyChanged(sensor: Sensor?, accuracy: Int)
Link copied to clipboard
open override fun onSensorChanged(event: SensorEvent?)
Link copied to clipboard
fun start(context: Context, onShake: () -> Unit)

Starts listening for shake gestures.

Link copied to clipboard
fun stop()

Stops listening for shake gestures and releases sensor resources.