New glance and widget views

Added ability to test if we're a widget or a watch-app. Added troubleshooting documentation.
This commit is contained in:
Philip Abbey
2023-12-21 11:37:30 +00:00
parent 4e739e918e
commit 3934ca53ba
61 changed files with 1074 additions and 540 deletions

View File

@ -27,6 +27,7 @@ class ScalableView extends WatchUi.View {
function initialize() {
View.initialize();
mScreenWidth = System.getDeviceSettings().screenWidth;
}
// Convert a fraction expressed as a percentage (%) to a number of pixels for the
@ -40,9 +41,6 @@ class ScalableView extends WatchUi.View {
// height > width.
//
function pixelsForScreen(pc as Lang.Float) as Lang.Number {
if (mScreenWidth == null) {
mScreenWidth = System.getDeviceSettings().screenWidth;
}
return Math.round(pc * mScreenWidth) / 100;
}
}