mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-04 02:48:41 +00:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user