App and Service improvements (#106)

This commit is contained in:
Ken Van Hoeylandt
2024-12-05 22:46:27 +01:00
committed by GitHub
parent e86a11b7e2
commit 50ee77d572
69 changed files with 692 additions and 596 deletions
@@ -1,5 +1,5 @@
#include <TactilityCore.h>
#include "ImageViewer.h"
#include "Log.h"
#include "lvgl.h"
#include "lvgl/Style.h"
#include "lvgl/Toolbar.h"
@@ -8,7 +8,7 @@ namespace tt::app::imageviewer {
#define TAG "image_viewer"
static void onShow(App& app, lv_obj_t* parent) {
static void onShow(AppContext& app, lv_obj_t* parent) {
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
lvgl::toolbar_create(parent, app);
@@ -22,16 +22,17 @@ static void onShow(App& app, lv_obj_t* parent) {
lv_obj_t* image = lv_img_create(wrapper);
lv_obj_align(image, LV_ALIGN_CENTER, 0, 0);
const Bundle& bundle = app.getParameters();
std::shared_ptr<const Bundle> bundle = app.getParameters();
tt_check(bundle != nullptr, "Parameters not set");
std::string file_argument;
if (bundle.optString(IMAGE_VIEWER_FILE_ARGUMENT, file_argument)) {
if (bundle->optString(IMAGE_VIEWER_FILE_ARGUMENT, file_argument)) {
std::string prefixed_path = "A:" + file_argument;
TT_LOG_I(TAG, "Opening %s", prefixed_path.c_str());
lv_img_set_src(image, prefixed_path.c_str());
}
}
extern const Manifest manifest = {
extern const AppManifest manifest = {
.id = "ImageViewer",
.name = "Image Viewer",
.type = TypeHidden,