[lvgl] Don't animate page change when not requested (#15069)

This commit is contained in:
Clyde Stubbs
2026-03-22 10:13:17 +10:00
committed by GitHub
parent 86ec218f75
commit dd82a91d8f
2 changed files with 9 additions and 5 deletions

View File

@@ -280,7 +280,7 @@ SWIPE_TRIGGERS = tuple(
LV_ANIM = LvConstant(
"LV_SCR_LOAD_ANIM_",
"LV_SCREEN_LOAD_ANIM_",
"NONE",
"OVER_LEFT",
"OVER_RIGHT",

View File

@@ -176,7 +176,11 @@ void LvglComponent::show_page(size_t index, lv_scr_load_anim_t anim, uint32_t ti
if (index >= this->pages_.size())
return;
this->current_page_ = index;
lv_scr_load_anim(this->pages_[this->current_page_]->obj, anim, time, 0, false);
if (anim == LV_SCREEN_LOAD_ANIM_NONE) {
lv_scr_load(this->pages_[this->current_page_]->obj);
} else {
lv_scr_load_anim(this->pages_[this->current_page_]->obj, anim, time, 0, false);
}
}
void LvglComponent::show_next_page(lv_scr_load_anim_t anim, uint32_t time) {
@@ -262,8 +266,8 @@ void LvglComponent::flush_cb_(lv_display_t *disp_drv, const lv_area_t *area, uin
if (!this->is_paused()) {
auto now = millis();
this->draw_buffer_(area, reinterpret_cast<lv_color_data *>(color_p));
ESP_LOGV(TAG, "flush_cb, area=%d/%d, %d/%d took %dms", area->x1, area->y1, lv_area_get_width(area),
lv_area_get_height(area), (int) (millis() - now));
ESP_LOGV(TAG, "flush_cb, area=%d/%d, %d/%d took %dms", (int) area->x1, (int) area->y1,
(int) lv_area_get_width(area), (int) lv_area_get_height(area), (int) (millis() - now));
}
lv_display_flush_ready(disp_drv);
}
@@ -619,7 +623,7 @@ void LvglComponent::setup() {
// Rotation will be handled by our drawing function, so reset the display rotation.
for (auto *disp : this->displays_)
disp->set_rotation(display::DISPLAY_ROTATION_0_DEGREES);
this->show_page(0, LV_SCR_LOAD_ANIM_NONE, 0);
this->show_page(0, LV_SCREEN_LOAD_ANIM_NONE, 0);
lv_display_trigger_activity(this->disp_);
}