You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 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()
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What's Changed
This version introduces implementations for the following sensors
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
startListening()
andstopListening()
- Use these methods from any sensor state function to start or stop observing the sensor events. For example:Full Changelog: 0.3.0...1.0.0
This discussion was created from the release v1.0.0.
Beta Was this translation helpful? Give feedback.
All reactions