v1.0.0
What's Changed
This version introduces implementations for the following sensors
- HeartBeat sensor
- Stationary Detect sensor
- Motion Detect sensor
- 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 totrue
. For example:
Use this while initiating the sensor state function
val accelerometerState = rememberAccelerometerSensorState(autoStart = false)
startListening()
andstopListening()
- 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