Implement a return app stack

Each opened app (screen) is pushed on a stack, which is then popped from
when returning instead of hard coded "previous apps". Return swipe and
refresh directions are automatically determined from the app transition.
This commit is contained in:
Riku Isokoski
2022-10-02 21:58:04 +03:00
committed by JF
parent 3617569795
commit 5ef3c0d3be
4 changed files with 104 additions and 54 deletions

View File

@@ -20,6 +20,8 @@
#include "displayapp/Messages.h"
#include "BootErrors.h"
#include "StaticStack.h"
namespace Pinetime {
namespace Drivers {
@@ -114,14 +116,18 @@ namespace Pinetime {
static void Process(void* instance);
void InitHw();
void Refresh();
void ReturnApp(Apps app, DisplayApp::FullRefreshDirections direction, TouchEvents touchEvent);
void LoadApp(Apps app, DisplayApp::FullRefreshDirections direction);
void LoadNewScreen(Apps app, DisplayApp::FullRefreshDirections direction);
void LoadScreen(Apps app, DisplayApp::FullRefreshDirections direction);
void PushMessageToSystemTask(Pinetime::System::Messages message);
Apps nextApp = Apps::None;
DisplayApp::FullRefreshDirections nextDirection;
System::BootErrors bootError;
void ApplyBrightness();
static constexpr size_t returnAppStackSize = 10;
StaticStack<Apps, returnAppStackSize> returnAppStack;
StaticStack<FullRefreshDirections, returnAppStackSize> appStackDirections;
};
}
}