fix(tabview, tileview): fix scrolling

The issue was introduced by 777fe1ea. It sends SCOLL_END event even when there is no scroll aniamtion
This commit is contained in:
Gabor Kiss-Vamosi
2022-05-18 12:03:37 +02:00
parent 523062b9ee
commit 22854ff3fb
2 changed files with 11 additions and 0 deletions

View File

@@ -308,6 +308,11 @@ static void cont_scroll_end_event_cb(lv_event_t * e)
lv_tabview_set_act(tv, lv_tabview_get_tab_act(tv), LV_ANIM_OFF);
}
else if(code == LV_EVENT_SCROLL_END) {
lv_indev_t * indev = lv_indev_get_act();
if(indev && indev->proc.state == LV_INDEV_STATE_PRESSED) {
return;
}
lv_point_t p;
lv_obj_get_scroll_end(cont, &p);

View File

@@ -7,6 +7,7 @@
* INCLUDES
*********************/
#include "lv_tileview.h"
#include "../../../core/lv_indev.h"
#if LV_USE_TILEVIEW
/*********************
@@ -157,6 +158,11 @@ static void tileview_event_cb(lv_event_t * e)
lv_tileview_t * tv = (lv_tileview_t *) obj;
if(code == LV_EVENT_SCROLL_END) {
lv_indev_t * indev = lv_indev_get_act();
if(indev && indev->proc.state == LV_INDEV_STATE_PRESSED) {
return;
}
lv_coord_t w = lv_obj_get_content_width(obj);
lv_coord_t h = lv_obj_get_content_height(obj);