Announcement

Collapse
No announcement yet.

FIT dynamic UnitLabels

Collapse
X
  • Time
  • Show
Clear All
new posts

  • FIT dynamic UnitLabels

    Hi
    I tried to make the unit Labels in FIT dynamically, depending on the user settings. like kmh or knots.
    Where speedUnit is the variable:
    Code:
    maxSpeedFitF = DataField.createField(
    "Max Speed",
    4,
    Fit.DATA_TYPE_FLOAT,
    {:mesgType=>Fit.MESG_TYPE_SESSION, :units=>speedUnit}
    Resources.xml :
    Code:
    <fitField id="4" displayInActivitySummary="true" sortOrder = "4" precision="1"
    dataLabel="@Strings.max_speed_label"
    unitLabel="@Strings.kmh_units"
    />
    But it takes always the string out of unitLabel="@Strings.kmh_units"
    and I HAVE to set a unitLabel in resources, otherwise I get a compilation error.
    How can I achive this?
    Thanks
    Seli17

  • #2
    For this case I just created multiple fit fields depending on the unitsLabel I wanted, and then just created the corresponding fit field to match that label, if that makes sense.

    Comment


    • #3
      Yes, this seems to work as a workaround and it even does not go "Out of Memory".
      Thank You

      Comment

      Working...
      X