incorrect time shown on clock when switching widgets #296
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs#296
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
when you change widgets, the clock widget briefly shows the old time before refreshing
This is caused because WidgetSet::switchWidget, is calling "setup" rather than "update":
void WidgetSet::switchWidget() {
m_screenManager->clearAllScreens();
getCurrent()->setup();
uint32_t start = millis();
getCurrent()->draw(true);
uint32_t end = millis();
Serial.printf("Drawing of %s took %d ms\n", getCurrent()->getName().c_str(), (end - start));
}
should be getCurrent()->update();
Please do not remove
setup()here, because this is also used by the widgets to know that they are about to be displayed.e.g. the ParqetWidget uses it to always start with the first screen.
(And yes, we should implement a better lifecycle management, e.g. like android (onCreate(), onResume(), onPause()...)
But adding
.update()after.setup()here should work.ok, but for me, setup should only be called ONCE when the orb starts and not every time we cycle to it..
Yes, that's definitely more logical.
As soon as we implement some other lifecycle hooks (e.g. onResume()/onPause() if we cycle to/from a widget) we can remove it here.
calling getCurrent()->update(); at switchWidget is causing the clockwidget to draw with missing digits. See issue #310 . This change got moved into dev with PR #271 I submitted PR #312 to revert this in dev