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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user