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:
@@ -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;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user