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