mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-01 17:38:40 +00:00
timers as statics, defensive popviews, no double confirmation, add pin
screen onBack, toggle state tweaks
This commit is contained in:
@ -244,6 +244,11 @@ class HomeAssistantPinConfirmationDelegate extends WatchUi.BehaviorDelegate {
|
||||
mTimer.stop();
|
||||
}
|
||||
WatchUi.popView(WatchUi.SLIDE_RIGHT);
|
||||
|
||||
// Set the toggle, if we have one
|
||||
if (mToggleMethod != null) {
|
||||
mToggleMethod.invoke(!mState);
|
||||
}
|
||||
mConfirmMethod.invoke(mState);
|
||||
} else {
|
||||
error();
|
||||
@ -285,10 +290,7 @@ class HomeAssistantPinConfirmationDelegate extends WatchUi.BehaviorDelegate {
|
||||
if (mTimer != null) {
|
||||
mTimer.stop();
|
||||
}
|
||||
// Undo the toggle, if we have one
|
||||
if (mToggleMethod != null) {
|
||||
mToggleMethod.invoke(!mState);
|
||||
}
|
||||
|
||||
WatchUi.popView(WatchUi.SLIDE_RIGHT);
|
||||
}
|
||||
|
||||
@ -314,6 +316,13 @@ class HomeAssistantPinConfirmationDelegate extends WatchUi.BehaviorDelegate {
|
||||
goBack();
|
||||
}
|
||||
|
||||
//! Handle the back button (ESC)
|
||||
//
|
||||
function onBack() as Lang.Boolean {
|
||||
goBack();
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user