Hi all,
is there a way to extend a device built-in DataField such as "Heart Rate" or "Cadence" ?
Thanks
Hi all,
is there a way to extend a device built-in DataField such as "Heart Rate" or "Cadence" ?
Thanks
Could you elaborate on what exactly what you're trying to accomplish by "extending a built-in datafield" (such as heart rate or cadence)?
If you want to change the behaviour or appearance of a built-in data field, no it's not possible.
The closest you can get is to create your own CIQ data field from scratch, which displays similar data (such as heart rate or cadence), pulled from the CIQ API.
For CIQ data fields, you have 2 choices:
- simple data field, where the app does not render the contents of field. Instead, you specify a fixed label (it can only be set once, when your app starts up) and you return a dynamic value (as a numeric value or string). In this case, the device decides how to render your data field label and value, and you're obviously limited in what can be displayed.
In an ideal world, this would mean that your simple data field would look similar to a native data field that displays similar information, but unfortunately this isn't always the case. (For example, there have been issues over the years where a CIQ simple data field would render the value using a font that's way too small, compared to the available space and compared to equivalent native fields.)
- complex data field, where the app renders the contents of the field. This is much more flexible than a simple data field (as you can display whatever you want)
Thank you so much, now is super clear.
Let's say I want to use Simple Data Field, how can I use the same built-in icons in the label field?
Is it possible? If so, how can I do it?
Same question for complex DataField.
Thanks!
Have you looked in the CIQ app store for an existing data field for your device that will show you want you want, and maybe more?
Let's say I want to use Simple Data Field, how can I use the same built-in icons in the label field?
Is it possible? If so, how can I do it?
Unfortunately you can't. The label is text (String), and you can't use a custom font (the device chooses the font), so you're limited to alphanumeric chars + whatever special chars are supported by the font that's chosen for the label.
Same goes for the value (returned by compute()). The value can be Numeric, Duration, String or Null, and the device will determine how to render it.
Same question for complex DataField.
You have complete control over the rendering of a complex data field. You still cannot use built-in icons (directly), but you can use your own bitmaps and custom fonts.
Here's a thread with a link to an old github repo for a Garmin icon custom font:
Super helpful, thank you so much!