Acknowledged

Instinct 2 screen dimensions possibly wrong on the simulator

Hi,

I have raised a question on the Discussion forum regarding the area available for drawing a data field on the Instinct 2 family. The full thread is available here: https://forums.garmin.com/developer/connect-iq/f/discussion/401206/how-to-handle-the-instinct-2-screen/1885985#1885985

Basically, I ran a test in order to get the screen dimensions of the I2 base model and compared the results with the reference page. While the reference page says its dimensions are 176 x 176, the dc.getWidth and dc.getHeight return 112 x 71. Also, on the original thread, it was noted that the onLayout seems to be called twice when only one was expected.

As a consequence, the area available for drawing is reduced:

The same code on I3, for example, works as expected:

The code is the following:

screenWidth = dc.getWidth();

screenHeight = dc.getHeight();

screenLines = [

            // Horizontal lines

            [0, screenHeight/4, screenWidth, screenHeight/4],

            [0, 2*(screenHeight/4), screenWidth, 2*(screenHeight/4)],

            [0, 3*(screenHeight/4), screenWidth, 3*(screenHeight/4)],

            // Vertical lines

            [screenWidth/2, 2*(screenHeight/8), screenWidth/2, 6*(screenHeight/8)]

        ];

and eventually I use dc.drawLine to draw the lines.

So, is this some kind of bug on the simulator? Does this also happen on real devices?

Parents
  • Additional context:

    forums.garmin.com/.../1886014

    There is really no 1 field layout. You can have 2 fields or more.  The subscreen is a field, and the screen except the subscreen is a field

    I see, that explains the following output with my test code, when I select 2 fields in the sim for instinct2:

    onLayout
    dc.height = 176
    dc.width = 176
    onLayout
    dc.height = 62
    dc.width = 62
    ...

    Thanks for that context!

    However, it doesn't explain:

    - why the simulator allows you to select 1 field for instinct2 (that would seem to be a bug)

    - why the simulator doesn't work the same way for Instinct E or MIP Instinct 3

    - why the simulator calls onLayout continuously for any layout with more than 1 field, on all devices. (Does this also happen on a real device? If so, that would also seem to be a bug. At the very least, the documentation should not tell people to load resources or do any other kind of one time setup in onLayout)

Comment
  • Additional context:

    forums.garmin.com/.../1886014

    There is really no 1 field layout. You can have 2 fields or more.  The subscreen is a field, and the screen except the subscreen is a field

    I see, that explains the following output with my test code, when I select 2 fields in the sim for instinct2:

    onLayout
    dc.height = 176
    dc.width = 176
    onLayout
    dc.height = 62
    dc.width = 62
    ...

    Thanks for that context!

    However, it doesn't explain:

    - why the simulator allows you to select 1 field for instinct2 (that would seem to be a bug)

    - why the simulator doesn't work the same way for Instinct E or MIP Instinct 3

    - why the simulator calls onLayout continuously for any layout with more than 1 field, on all devices. (Does this also happen on a real device? If so, that would also seem to be a bug. At the very least, the documentation should not tell people to load resources or do any other kind of one time setup in onLayout)

Children
No Data