This is an experiment based on #1571. It is about reducing all the different places in the code where apps are declared.
I am not experienced with this, so any input would be really helpful. Maybe we can figure something out together. Take this PR as a basis for discussion. I would like to learn from this. And hopefully we can find a good solution on how to handle apps :relieved:
The idea is to implement an App class that gets inherited by all Screens we consider to be apps. This means all the screens that could one day be loaded dynamically (watch faces maybe their own thing...).
For example QuickSettings is not an App, but Twos is.
There are some issues to be resolved with the current state:
The apps are explicitly instanciated in the DisplayApp.cpp and with custom arguments. This PR tries to implement an AppInterface that provides the same way of creation for all apps. Right now, this is done via a Get method that is known to be present with all apps. We can further on reduce the capabilities that we give each app, but I would like to focus on getting this to run the easy way first.
The ApplicationList explicitly lists all the apps and their symbols. This PR implements a GetSymbol method for the App class. This moves the declaration of the symbol inside the app.
All apps are handled individually. This is not fixed right now, but I would like to have an AppController in the later progress that can handle the App objects. The interface of the App class must be enough to do all the things the controller has to do.
This is an experiment based on #1571. It is about reducing all the different places in the code where apps are declared.
I am not experienced with this, so any input would be really helpful. Maybe we can figure something out together. Take this PR as a basis for discussion. I would like to learn from this. And hopefully we can find a good solution on how to handle apps :relieved:
The idea is to implement an
App
class that gets inherited by allScreen
s we consider to be apps. This means all the screens that could one day be loaded dynamically (watch faces maybe their own thing...). For exampleQuickSettings
is not anApp
, butTwos
is.There are some issues to be resolved with the current state:
DisplayApp.cpp
and with custom arguments. This PR tries to implement anAppInterface
that provides the same way of creation for all apps. Right now, this is done via aGet
method that is known to be present with all apps. We can further on reduce the capabilities that we give each app, but I would like to focus on getting this to run the easy way first.ApplicationList
explicitly lists all the apps and their symbols. This PR implements aGetSymbol
method for theApp
class. This moves the declaration of the symbol inside the app.AppController
in the later progress that can handle theApp
objects. The interface of theApp
class must be enough to do all the things the controller has to do.I would really like your ideas and feedback! :)