Shapes in Layout

I was trying to use a shape in my app layout but I'm getting the following error:
"BUILD: ERROR: Problem validating a resource file: cvc-complex-type.2.4.a: Invalid content was found starting with element 'shape'. One of '{label, drawable, bitmap}' is expected."

Here is what my shape looks like:
<shape id="id_first_dot" type="circle" x="5" y="5" radius="3" color="0xFF0000"/>

I'm using the SDK 1.2.11.
Are shapes only supported in 2.x?
Should I use the 2.x SDK?

Is it device specific?
I was trying this on an epix.
  • Hi,

    The way you can handle this is to define a new drawable (which consists of your shape) and then use the id of that drawable in your layout.
    As the error message says in Layout only <label/>, <drawable/> and <bitmap/> are supported.

    See http://developer.garmin.com/connect-iq/developer-tools/user-interface/ "Drawables" how to define them.

    Best regards
    |JO|
  • Thanks for the tip.
    But what with that shape drawable which is documented in the page you are linking?
    Was it never implemented even though it's documented?
  • My understanding is that a layout can only contain labels, bitmaps, and drawables. If you want a shape to be part of a layout you have to specify a drawable-list in an resource xml-file with all the shapes you want and then use <drawable id="your ID"/> in your layout definition to load it.

    At least that's how it's described in the link and for me it worked. I guess that shapes have to be treated differently than labels and images in terms of rendering. Who knows... The main thing is it works ;)

    Edit: the shape drawable should be used inside of your drawable-list definition. Read the linked page two or three times carefully and you'll understand the given code examples. If not I can post an example later.
  • shape are not working on SDK 2.1 either.
    Tried epix and fenix too, none are supporting shapes.
    Too bad, would have been practical.
    The documentation should be updated really.
  • I see, another case of RTFM, my bad.
    Still rather odd format but why not.