Open
Conversation
Vader-Femi
commented
Feb 28, 2024
- Added DSL clock faces for time and complications.
- Added permission for BODY_SENSORS in app-watch manifest file
Added DSL clock faces for time and complications
yschimke
reviewed
Feb 28, 2024
| var hr by remember { mutableIntStateOf(0) } | ||
|
|
||
| val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager | ||
| val hrCounter = sensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE) |
Collaborator
There was a problem hiding this comment.
It seems a bad idea to be using SensorManager in a Watchface.
Could you use either of
- Complications
- WHS PassiveClient ?
Member
There was a problem hiding this comment.
FYI, "WHS" stands for "Wear Health Services", and the doc on it and passive client is here: https://developer.android.com/health-and-fitness/guides/health-services/compatibility#passive_monitoring_client
Author
There was a problem hiding this comment.
I used WHS initially, but it required me to increase the minSdk to 30, so I removed it
LouisCAD
requested changes
Mar 4, 2024
shared/src/main/kotlin/watchfaces/dslclock/DSLClockComplication.kt
Outdated
Show resolved
Hide resolved
Comment on lines
191
to
192
| val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager | ||
| val hrCounter = sensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE) |
Member
There was a problem hiding this comment.
Same as above in Battery, but we probably want to replace that with use of Complications API or WHS PassiveClient anyway.
shared/src/main/kotlin/watchfaces/dslclock/DSLClockComplication.kt
Outdated
Show resolved
Hide resolved
shared/src/main/kotlin/watchfaces/dslclock/DSLClockComplication.kt
Outdated
Show resolved
Hide resolved
shared/src/main/kotlin/watchfaces/dslclock/DSLClockComplication.kt
Outdated
Show resolved
Hide resolved
shared/src/main/kotlin/watchfaces/dslclock/DSLClockComplication.kt
Outdated
Show resolved
Hide resolved
- Removed Heart rate from complications face - Removed unused rotation from various OClockCanvas - Changed date format to "yyyy/MM/dd" for shorter length - Removed hardcoded offset values - Kept battery BroadcastReceiver in a DisposableEffect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.