mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-04-30 20:52:27 +00:00
GUI refresh amendments
This commit is contained in:
@ -196,9 +196,11 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
break;
|
||||
|
||||
case 200:
|
||||
mMenuStatus = RezStrings.getAvailable();
|
||||
if (Settings.getCacheConfig()) {
|
||||
Storage.setValue("menu", data as Lang.Dictionary);
|
||||
mMenuStatus = RezStrings.getCached();
|
||||
} else {
|
||||
mMenuStatus = RezStrings.getAvailable();
|
||||
}
|
||||
if (!mIsGlance) {
|
||||
buildMenu(data);
|
||||
@ -268,6 +270,7 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
}
|
||||
} else {
|
||||
mMenuStatus = RezStrings.getCached();
|
||||
WatchUi.requestUpdate();
|
||||
if (!mIsGlance) {
|
||||
buildMenu(menu);
|
||||
}
|
||||
@ -467,15 +470,15 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
RezStrings.update_glance();
|
||||
mApiStatus = RezStrings.getChecking();
|
||||
mMenuStatus = RezStrings.getChecking();
|
||||
updateGlance();
|
||||
updateStatus();
|
||||
Settings.update();
|
||||
mTimer = new Timer.Timer();
|
||||
mTimer.start(method(:updateGlance), Globals.scApiBackoff, true);
|
||||
mTimer.start(method(:updateStatus), Globals.scApiBackoff, true);
|
||||
return [new HomeAssistantGlanceView(self)];
|
||||
}
|
||||
|
||||
// Required for the Glance update timer.
|
||||
function updateGlance() as Void {
|
||||
function updateStatus() as Void {
|
||||
fetchMenuConfig();
|
||||
fetchApiStatus();
|
||||
}
|
||||
|
@ -104,12 +104,12 @@ class HomeAssistantView extends WatchUi.Menu2 {
|
||||
//
|
||||
class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate {
|
||||
private var mIsRootMenuView as Lang.Boolean = false;
|
||||
private var mTimer as QuitTimer;
|
||||
private var mTimer as QuitTimer;
|
||||
|
||||
function initialize(isRootMenuView as Lang.Boolean) {
|
||||
Menu2InputDelegate.initialize();
|
||||
mIsRootMenuView = isRootMenuView;
|
||||
mTimer = getApp().getQuitTimer();
|
||||
mTimer = getApp().getQuitTimer();
|
||||
}
|
||||
|
||||
function onBack() {
|
||||
|
@ -115,6 +115,10 @@ class RootView extends ScalableView {
|
||||
mMenuStatus.setText(mApp.getMenuStatus());
|
||||
mMenuStatus.draw(dc);
|
||||
}
|
||||
|
||||
function onShow() as Void {
|
||||
WatchUi.requestUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
class RootViewDelegate extends WatchUi.BehaviorDelegate {
|
||||
|
Reference in New Issue
Block a user