Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Added DSLClock #8

wants to merge 3 commits into from

Conversation

Vader-Femi
Copy link

  • 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
@LouisCAD LouisCAD changed the title Added DCLClock Added DSLClock 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)
Copy link
Collaborator

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 ?

Copy link
Author

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

Copy link
Member

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

Copy link
Author

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

Comment on lines 191 to 192
val sensorManager = context.getSystemService(Context.SENSOR_SERVICE) as SensorManager
val hrCounter = sensorManager.getDefaultSensor(Sensor.TYPE_HEART_RATE)
Copy link
Member

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/DSLClockTime.kt Outdated Show resolved Hide resolved
shared/src/main/kotlin/watchfaces/dslclock/DSLClockTime.kt Outdated Show resolved Hide resolved
shared/src/main/kotlin/watchfaces/dslclock/DSLClockTime.kt Outdated Show resolved Hide resolved
@Vader-Femi Vader-Femi marked this pull request as draft March 10, 2024 21:13
- 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
@Vader-Femi Vader-Femi marked this pull request as ready for review March 10, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants