#include "../../../Tactility/Private/Tactility/service/gui/GuiService.h" #include #include #include #include #include #include #include using namespace tt::app; class HelloWorldApp : public App { std::shared_ptr displayDevice; // void onShow(AppContext& context, lv_obj_t* parent) override { // lv_obj_t* toolbar = tt::lvgl::toolbar_create(parent, context); // lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0); // // lv_obj_t* label = lv_label_create(parent); // lv_label_set_text(label, "Hello, world!"); // lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); // } void onCreate(AppContext& appContext) override { tt::service::stopService("Statusbar"); tt::service::stopService("Gui"); using namespace tt::hal; displayDevice = findFirstDevice(Device::Type::Display); if (displayDevice == nullptr) { TT_LOG_E("HelloWorld", "Display device not found"); stop(); } else { if (displayDevice->supportsLvgl() && displayDevice->getLvglDisplay() != nullptr) { if (!displayDevice->stopLvgl()) { TT_LOG_E("HelloWorld", "Failed to detach display from LVGL"); } } } vTaskDelay(2000 / portTICK_PERIOD_MS); stop(); // stop this app } void onDestroy(AppContext& appContext) override { if (displayDevice != nullptr) { if (displayDevice->supportsLvgl() && displayDevice->getLvglDisplay() == nullptr) { TT_LOG_I("HelloWorld", "Starting LVGL"); displayDevice->startLvgl(); } } tt::service::startService("Gui"); tt::service::startService("Statusbar"); } }; extern const AppManifest hello_world_app = { .id = "HelloWorld", .name = "Hello World", .createApp = create };