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
  • Also, the device reference guide for Instinct 2 shows the same thing as the simulator, for 1-field and 2-field layouts.

    https://developer.garmin.com/connect-iq/reference-guides/devices-reference/#instinct%C2%AE2solardualpowerd%C4%93zledition

    i.e.

    - 1-field layout exists (according to the doc), and is just a small field in the upper left hand corner
    - 2-field layout is: 1 field with the entire screen, and 1 field with the subscreen. (Note that this is not 100% clear from the diagram)

    Similarly, the behavior of instinct3solar45mm in the sim for 1 and 2-field layouts matches the doc:

    i.e.

    - 1 field layout is the whole screen

    - 2 field layout is small field in upper left hand corner, and wide field in bottom half, both excluding the subscreen. Again this is not super clear from the diagram.

Comment
  • Also, the device reference guide for Instinct 2 shows the same thing as the simulator, for 1-field and 2-field layouts.

    https://developer.garmin.com/connect-iq/reference-guides/devices-reference/#instinct%C2%AE2solardualpowerd%C4%93zledition

    i.e.

    - 1-field layout exists (according to the doc), and is just a small field in the upper left hand corner
    - 2-field layout is: 1 field with the entire screen, and 1 field with the subscreen. (Note that this is not 100% clear from the diagram)

    Similarly, the behavior of instinct3solar45mm in the sim for 1 and 2-field layouts matches the doc:

    i.e.

    - 1 field layout is the whole screen

    - 2 field layout is small field in upper left hand corner, and wide field in bottom half, both excluding the subscreen. Again this is not super clear from the diagram.

Children
No Data