Hi, I have tried everything now but still having issues with presentation of my Complex data field on Fenix 6 Pro and Fenix 6X devices (other devices work just fine).
When the activity starts, the value of my data field is rendered with a too large font and is also vertically misaligned. Only when the user toggles to another screen and then go back, the value is rendered correctly. I can't see any obvious issues in my code that could cause it (however, I'm not ruling it out). This problem occurred a couple of months back, the first user problem report dates March 2nd. I did made some updates to the datafield around that time, but nothing that should have impacted the layout AFAIK.
You can clearly see the issue in this video (sent from one of my users), the "glucose" data field does not render correctly when you start the activity but after toggling away and back from the screen it uses the correct font and alignment.
Video of rendering issue on F6 Pro
I use device specific layouts. For fenix 6 Pro I have the layouts defined in "resources-round-260x260/layouts/layouts.xml". Both "Value" and "Label" renders incorrectly. Here is the Fenix 6 Pro layout used for the 4-field layout:
<layout id="MainLayout"> <drawable class="Background" /> <label id="label" x="dc.getWidth()/2" y="0" color="Graphics.COLOR_LT_GRAY" justification="Graphics.TEXT_JUSTIFY_CENTER" font="Graphics.FONT_XTINY" /> <label id="value" x="dc.getWidth()/2 + 20" y="dc.getHeight()/2" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_RIGHT | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_LARGE" /> <bitmap id="img" x="dc.getWidth()/2 + 25" y="dc.getHeight()/2 - 15" filename="..\..\resources\drawables\None.png" /> <label id="message" x="dc.getWidth()/2" y="dc.getHeight()/2 + 5" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_MEDIUM" /> </layout>
And here is the Fenix 6 Pro layout I use for the 6-field layout:
<layout id="MainLayoutSmall"> <drawable class="Background" /> <label id="label" x="dc.getWidth()/2" y="0" color="Graphics.COLOR_LT_GRAY" justification="Graphics.TEXT_JUSTIFY_CENTER" font="Graphics.FONT_XTINY" /> <label id="value" x="dc.getWidth()/2 + 20" y="dc.getHeight()/2 + 5" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_RIGHT | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_MEDIUM" /> <bitmap id="img" x="dc.getWidth()/2 + 25" y="dc.getHeight()/2 - 7" filename="..\..\resources\drawables\None.png" /> <label id="message" x="dc.getWidth()/2" y="dc.getHeight()/2 + 5" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_SMALL" /> </layout>
I set the layout in my onLayout() function in the datafield view class:
function onLayout(dc) { var obscurityFlags = DataField.getObscurityFlags(); View.setLayout(null); // Top left quadrant so we'll use the top left layout (3) if (obscurityFlags == (OBSCURE_TOP | OBSCURE_LEFT)) { View.setLayout(Rez.Layouts.TopLeftLayout(dc)); // Top right quadrant so we'll use the top right layout (6) } else if (obscurityFlags == (OBSCURE_TOP | OBSCURE_RIGHT)) { View.setLayout(Rez.Layouts.TopRightLayout(dc)); // Bottom left quadrant so we'll use the bottom left layout (9) } else if (obscurityFlags == (OBSCURE_BOTTOM | OBSCURE_LEFT)) { View.setLayout(Rez.Layouts.BottomLeftLayout(dc)); // Bottom right quadrant so we'll use the bottom right layout (12) } else if (obscurityFlags == (OBSCURE_BOTTOM | OBSCURE_RIGHT)) { View.setLayout(Rez.Layouts.BottomRightLayout(dc)); // square device (edge) layout (0) } else if (obscurityFlags == 0) { if (dc.getHeight()>90 && dc.getWidth()>150) { View.setLayout(Rez.Layouts.EdgeLayoutXL(dc)); } else { View.setLayout(Rez.Layouts.EdgeLayout(dc)); } // one-field full layout (15) } else if (obscurityFlags == (OBSCURE_TOP | OBSCURE_RIGHT | OBSCURE_BOTTOM | OBSCURE_LEFT)) { View.setLayout(Rez.Layouts.FullLayout(dc)); // For all other fields, use the generic centered layout } else { if (dc.getHeight() < 70) { View.setLayout(Rez.Layouts.MainLayoutSmall(dc)); } else { View.setLayout(Rez.Layouts.MainLayout(dc)); } } View.findDrawableById("label").setText(Rez.Strings.label); return true; }
As a last point: everything looks just fine in the device simulator.
Please forgive me if there is a coding/design error and not an actual bug. I put it as a bug report for now and I hope my explanation make sense.
TIA
/Fredrik