Skip to content

v1.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 10 Jun 11:24
229f0c0

What's Changed

This version introduces implementations for the following sensors

  1. HeartBeat sensor
  2. Stationary Detect sensor
  3. Motion Detect sensor
  4. Significant Motion sensor

This version also introduces a few methods and parameters to manage sensor event subscriptions

  • autoStart - This is a boolean parameter available in all sensor state functions to declare whether to start observing the sensor events as soon as the state instance is created or not. It defaults to true. For example:

Use this while initiating the sensor state function

val accelerometerState = rememberAccelerometerSensorState(autoStart = false)
  • startListening() and stopListening() - Use these methods from any sensor state function to start or stop observing the sensor events. For example:
val accelerometerState = rememberAccelerometerSensorState(autoStart = false)

LaunchedEffect(doesUserWantToObserveEvents) {
    if (doesUserWantToObserveEvents) {
        accelerometerState.startListening()
    } else {
        accelerometerState.stopListening()
    }
}

Full Changelog: 0.3.0...1.0.0