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

@ -106,10 +106,21 @@ class ErrorView extends ScalableView {
create(text); // Ignore returned values
if (!mShown) {
WatchUi.pushView(instance, instance.getDelegate(), WatchUi.SLIDE_UP);
// This must be last to avoid a race condition with unShow(), where the
// ErrorView can't be dismissed.
mShown = true;
}
}
static function unShow() as Void {
if (mShown) {
WatchUi.popView(WatchUi.SLIDE_DOWN);
// This must be last to avoid a race condition with show(), where the
// ErrorView can't be dismissed.
mShown = false;
}
}
// Internal show now we're not a static method like 'show()'.
function setText(text as Lang.String) as Void {
mText = text;
@ -119,13 +130,6 @@ class ErrorView extends ScalableView {
}
}
static function unShow() as Void {
if (mShown) {
mShown = false;
WatchUi.popView(WatchUi.SLIDE_DOWN);
}
}
}
class ErrorDelegate extends WatchUi.BehaviorDelegate {