feat: Add gif support (#1183)

* feat: Add gif support

* fix: compiling errors

* fix remove bg image
This commit is contained in:
Xiaoxia
2025-09-11 03:53:12 +08:00
committed by GitHub
parent 4048647ef8
commit 57c2c64047
34 changed files with 1690 additions and 327 deletions

View File

@@ -4,7 +4,8 @@
{
"name": "otto-robot",
"sdkconfig_append": [
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/16m.csv\""
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/16m.csv\"",
"CONFIG_LVGL_USE_GIF=y"
]
}
]

View File

@@ -61,8 +61,8 @@ OttoEmojiDisplay::OttoEmojiDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_p
void OttoEmojiDisplay::SetupGifContainer() {
DisplayLockGuard lock(this);
if (emotion_label_) {
lv_obj_del(emotion_label_);
if (emoji_label_) {
lv_obj_del(emoji_label_);
}
if (chat_message_label_) {
@@ -80,11 +80,11 @@ void OttoEmojiDisplay::SetupGifContainer() {
lv_obj_set_flex_grow(content_, 1);
lv_obj_center(content_);
emotion_label_ = lv_label_create(content_);
lv_label_set_text(emotion_label_, "");
lv_obj_set_width(emotion_label_, 0);
lv_obj_set_style_border_width(emotion_label_, 0, 0);
lv_obj_add_flag(emotion_label_, LV_OBJ_FLAG_HIDDEN);
emoji_label_ = lv_label_create(content_);
lv_label_set_text(emoji_label_, "");
lv_obj_set_width(emoji_label_, 0);
lv_obj_set_style_border_width(emoji_label_, 0, 0);
lv_obj_add_flag(emoji_label_, LV_OBJ_FLAG_HIDDEN);
emotion_gif_ = lv_gif_create(content_);
int gif_size = LV_HOR_RES;