1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(scroll): scrolling animation and finger dragging conflict during continuous sliding, causing flickering (#7522)

Signed-off-by: chenjinglin <chenjinglin@xiaomi.com>
This commit is contained in:
Ackerman 2025-01-15 01:40:50 +08:00 committed by GitHub
parent 3f13398673
commit 177b0bd044
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 0 deletions

View File

@ -442,6 +442,12 @@ bool lv_obj_is_scrolling(const lv_obj_t * obj)
return false;
}
void lv_obj_stop_scroll_anim(const lv_obj_t * obj)
{
lv_anim_delete((lv_obj_t *)obj, scroll_y_anim);
lv_anim_delete((lv_obj_t *)obj, scroll_x_anim);
}
void lv_obj_update_snap(lv_obj_t * obj, lv_anim_enable_t anim_en)
{
lv_obj_update_layout(obj);

View File

@ -255,6 +255,13 @@ void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en);
*/
bool lv_obj_is_scrolling(const lv_obj_t * obj);
/**
* Stop scrolling the current object
*
* @param obj The object being scrolled
*/
void lv_obj_stop_scroll_anim(const lv_obj_t * obj);
/**
* Check children of `obj` and scroll `obj` to fulfill scroll_snap settings.
* @param obj Widget whose children need to be checked and snapped

View File

@ -1301,6 +1301,10 @@ static void indev_proc_press(lv_indev_t * indev)
if(indev_act->wait_until_release) return;
if(indev->pointer.scroll_obj) {
lv_obj_stop_scroll_anim(indev->pointer.scroll_obj);
}
lv_indev_scroll_handler(indev);
if(indev_reset_check(indev)) return;
indev_gesture(indev);