Datafield with exact same layoutbehavour as SimpleDataField

Former Member
Former Member
Hi, I'm trying to develop a Datafield, but I want the layout to be the same as a SimpleDataField (so the sizes, paddings and margins are exact the same as a Standard Field).
I am doing this, because I want to change Backgroundcolor of the field.

What (font)sizes are used? How can I achieve this the most simple way? I want them to look the same in all obscurities.

Kind regards,
  • This info is unfortunately not available. You have to do a bit of trial and error to get the display positioning right. On my website http://starttorun.info i have a tutorial on the steps carousel project: This is a "complex" datafield that tries to mimic the layout of the simple datafield. So you could use that as a starting point.
  • Former Member
    Former Member
    Google has already showed me the way to that page! Thanks ;). It's super helpfull!
  • On thing to consider, is that one some watches (such as the f5), there are two 3-field layouts, with a top, middle, and bottom field. One of the layouts is with the label, and one without with a larger font for the data. I can't think of a way a CIQ DF can see which type it's running in, so you may have to do something like always assume labels.
  • On thing to consider, is that one some watches (such as the f5), there are two 3-field layouts, with a top, middle, and bottom field. One of the layouts is with the label, and one without with a larger font for the data. I can't think of a way a CIQ DF can see which type it's running in, so you may have to do something like always assume labels.


    I think on most watches you could deduce it:
    * in the onlayout function you can query DataField.getObscurityFlags() and find out if OBSCURE_TOP / OBSCURE_LEFT / OBSCURE_RIGHT / OBSCURE_BOTTOM
    * in onUpdate you can get the width and higth of the dc

    The combination of the 2 should give you a good idea on watches, but on edge devices you'll probably have no clue if it's one of the middle rows...
  • I was referring to the field layouts on the f5, where you can hide the label. 3 fields in both cases, and the obscurity flags are the same in both cases, as is the width/height of the dc. It's just in one case the height of the font used for the data is shorter to allow for the label.

    So for the standard timer, in one case it's both a label and value

    timer
    0:00

    and in the other case, just the value

    0:00


    There's no way to detect if a label should be shown or not within CIQ.

  • In the sim for the f5/x/s and 935, they are both the "3A" layout, but on the watches there's 2 versions of 3A - one with labels, and one without.