Update apps for SDK updates (#38)
The updates mainly relate to lvgl-module changes.
This commit is contained in:
committed by
GitHub
parent
4f635d38e3
commit
b1e7eb999a
@@ -5,12 +5,12 @@
|
||||
#include "TwoEleven.h"
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <tt_lvgl_toolbar.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
#include <tt_app_alertdialog.h>
|
||||
#include <tt_app_selectiondialog.h>
|
||||
#include <tt_preferences.h>
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/lvgl_fonts.h>
|
||||
#include <lvgl/fonts.h>
|
||||
#include <TactilityCpp/LvglLock.h>
|
||||
|
||||
constexpr auto* TAG = "TwoEleven";
|
||||
@@ -257,7 +257,7 @@ void TwoEleven::onShow(AppHandle appHandle, lv_obj_t* parent) {
|
||||
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
|
||||
|
||||
// Create toolbar
|
||||
toolbar = tt_lvgl_toolbar_create_for_app(parent, appHandle);
|
||||
toolbar = lvgl_toolbar_create(parent, "2048");
|
||||
lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0);
|
||||
|
||||
// Create main wrapper
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
#include "TwoElevenHelpers.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <tt_lvgl_keyboard.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/keyboard.h>
|
||||
|
||||
static void game_play_event(lv_event_t * e);
|
||||
static void btnm_event_cb(lv_event_t * e);
|
||||
@@ -18,7 +19,7 @@ static void delete_event(lv_event_t * e)
|
||||
twoeleven_t * game_2048 = (twoeleven_t *)lv_obj_get_user_data(obj);
|
||||
if (game_2048) {
|
||||
// Restore edit mode and remove from group before cleanup
|
||||
if (tt_lvgl_hardware_keyboard_is_available()) {
|
||||
if (device_has_active_by_type(&KEYBOARD_TYPE)) {
|
||||
lv_group_t* group = lv_group_get_default();
|
||||
if (group) lv_group_set_editing(group, false);
|
||||
lv_group_remove_obj(game_2048->btnm);
|
||||
@@ -140,7 +141,7 @@ lv_obj_t * twoeleven_create(lv_obj_t * parent, uint16_t matrix_size)
|
||||
lv_obj_add_event_cb(game_2048->btnm, btnm_event_cb, LV_EVENT_DRAW_TASK_ADDED, NULL);
|
||||
lv_obj_add_event_cb(obj, delete_event, LV_EVENT_DELETE, NULL);
|
||||
|
||||
if (tt_lvgl_hardware_keyboard_is_available()) {
|
||||
if (device_has_active_by_type(&KEYBOARD_TYPE)) {
|
||||
lv_group_t* group = lv_group_get_default();
|
||||
if (group) {
|
||||
lv_group_add_obj(group, game_2048->btnm);
|
||||
|
||||
Reference in New Issue
Block a user