How can I support identical layouts for different display geometries, in my case, FR245 vs. Fenix3? I'll ask my ultimate question here so it does not get lost in the cacophony below then I'll ask again where it is most relevant.
How can I programmatically detect in my Monkey C code which device is currently running?
As you can see the watch face is quite basic:
- A time string defined in /resources*/layouts/layout.xml
- Various data strings defined in /resources*/layouts/layout.xml
- Three icons for battery, BLE, and notifications defined in resources/drawables/drawables.xml
Now, for the first two items I of course have them define in separate rez folders (*resources-fr235 and *resources-fenix3). This works great for tinkering with the font sizes and locations needed for the different screens, because I can change those values directly in the XMLs, thus keeping them separate and unique. I just simply call View.findDrawablById("myString").setText(myValue) and let the values in the XML values handle
details.
The problem comes with the icons. Drawables.xml does not seem to support setting x/y values; I have to handle that all directly in the main code:
/*[code1]*/ myPng = Ui.loadResource(Rez.Drawables.myPngId); followed by...
.
. //other stuff
.
/*[code2]*/ dc.drawBitmap(xVal, yVal, myPng);
This being the case, I am left with one watch face with an undesired layout. In the attached images (inline below), fr235 is how I want it; fenix3 is not. How can I programmatically detect in my Monkey C code which device is currently running to that I can throw [code2] in an if/else statement, giving me the power to set separate values?
I am relatively new at this so my requested approach may be off in the weeds. If so your criticism is desired and appreciated.
Thanks,
Jeff