- Update ILI9341 driver to v2.0.1 - Lots of code cleanup for apps - Refactor app "type" into "category" and added flags to the manifest (for show/hide statusbar and for hidden apps) - Rename some ElfApp-related functionality and improved the way the static data was managed - Rename "filebrowser" to "files" - Added cstring functions to tt_init.cpp - Minor fix in Boot app - Updated external apps for SDK changes
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
#include <Tactility/app/files/View.h>
|
|
#include <Tactility/app/files/State.h>
|
|
#include <Tactility/app/AppContext.h>
|
|
|
|
#include <Tactility/Assets.h>
|
|
#include <Tactility/service/loader/Loader.h>
|
|
|
|
#include <memory>
|
|
|
|
namespace tt::app::files {
|
|
|
|
extern const AppManifest manifest;
|
|
|
|
class FilesApp final : public App {
|
|
|
|
std::unique_ptr<View> view;
|
|
std::shared_ptr<State> state;
|
|
|
|
public:
|
|
|
|
FilesApp() {
|
|
state = std::make_shared<State>();
|
|
view = std::make_unique<View>(state);
|
|
}
|
|
|
|
void onShow(AppContext& appContext, lv_obj_t* parent) override {
|
|
view->init(appContext, parent);
|
|
}
|
|
|
|
void onResult(AppContext& appContext, TT_UNUSED LaunchId launchId, Result result, std::unique_ptr<Bundle> bundle) override {
|
|
view->onResult(launchId, result, std::move(bundle));
|
|
}
|
|
};
|
|
|
|
extern const AppManifest manifest = {
|
|
.id = "Files",
|
|
.name = "Files",
|
|
.icon = TT_ASSETS_APP_ICON_FILES,
|
|
.category = Category::System,
|
|
.flags = AppManifest::Flags::Hidden,
|
|
.createApp = create<FilesApp>
|
|
};
|
|
|
|
void start() {
|
|
service::loader::startApp(manifest.id);
|
|
}
|
|
|
|
} // namespace
|