Give activities names and log when entering and exiting them (#92)
## Summary * Give activities name and log when entering and exiting them * Clearer logs when attempting to debug, knowing where users are coming from/going to helps
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include "images/CrossLarge.h"
|
||||
|
||||
void BootActivity::onEnter() {
|
||||
Activity::onEnter();
|
||||
|
||||
const auto pageWidth = GfxRenderer::getScreenWidth();
|
||||
const auto pageHeight = GfxRenderer::getScreenHeight();
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
class BootActivity final : public Activity {
|
||||
public:
|
||||
explicit BootActivity(GfxRenderer& renderer, InputManager& inputManager) : Activity(renderer, inputManager) {}
|
||||
explicit BootActivity(GfxRenderer& renderer, InputManager& inputManager) : Activity("Boot", renderer, inputManager) {}
|
||||
void onEnter() override;
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "images/CrossLarge.h"
|
||||
|
||||
void SleepActivity::onEnter() {
|
||||
Activity::onEnter();
|
||||
renderPopup("Entering Sleep...");
|
||||
|
||||
if (SETTINGS.sleepScreen == CrossPointSettings::SLEEP_SCREEN_MODE::CUSTOM) {
|
||||
@@ -170,11 +171,16 @@ void SleepActivity::renderBitmapSleepScreen(const Bitmap& bitmap) const {
|
||||
}
|
||||
|
||||
void SleepActivity::renderCoverSleepScreen() const {
|
||||
if (APP_STATE.openEpubPath.empty()) {
|
||||
return renderDefaultSleepScreen();
|
||||
}
|
||||
|
||||
Epub lastEpub(APP_STATE.openEpubPath, "/.crosspoint");
|
||||
if (!lastEpub.load()) {
|
||||
Serial.println("[SLP] Failed to load last epub");
|
||||
return renderDefaultSleepScreen();
|
||||
}
|
||||
|
||||
if (!lastEpub.generateCoverBmp()) {
|
||||
Serial.println("[SLP] Failed to generate cover bmp");
|
||||
return renderDefaultSleepScreen();
|
||||
|
||||
@@ -5,7 +5,8 @@ class Bitmap;
|
||||
|
||||
class SleepActivity final : public Activity {
|
||||
public:
|
||||
explicit SleepActivity(GfxRenderer& renderer, InputManager& inputManager) : Activity(renderer, inputManager) {}
|
||||
explicit SleepActivity(GfxRenderer& renderer, InputManager& inputManager)
|
||||
: Activity("Sleep", renderer, inputManager) {}
|
||||
void onEnter() override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user