-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added DSLClock #8
base: main
Are you sure you want to change the base?
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
var hr by remember { mutableIntStateOf(0) } | ||
|
||
val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager | ||
val hrCounter = sensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems a bad idea to be using SensorManager in a Watchface.
Could you use either of
- Complications
- WHS PassiveClient ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I will look into that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used WHS initially, but it required me to increase the minSdk to 30, so I removed it
shared/src/main/kotlin/watchfaces/dslclock/DSLClockComplication.kt
Outdated
Show resolved
Hide resolved
val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager | ||
val hrCounter = sensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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