I want to know if the page produces an event when it scrolls to the edge. I can’t find a description for this event in the documentation, but here’s another API:lv_page_set_edge_flash();So I think there should be an event like that.
What MCU/Processor/Board and compiler are you using?
stm32l4
What LVGL version are you using?
7.10.0
What do you want to achieve?
I want to do something automatically when the page scrolls to the edge
@kisvegabor It looks like the page object is gone in v8 as the scrolling features were merged into lv_obj directly. Do you think it’s worth adding an event to v7 for this only to reimplement it for v8?
@juneofive As a workaround for v7, you should be able to register a custom signal handler on lv_page_get_scrollable(page):
static lv_signal_cb_t old_page_scrollable_signal;
static lv_res_t custom_page_scrollable_signal(lv_obj_t * scrl, lv_signal_t sign, void * param)
{
lv_res_t res;
/* Include the ancient signal function */
res = old_page_scrollable_signal(scrl, sign, param);
if(res != LV_RES_OK) return res;
lv_obj_t * page = lv_obj_get_parent(scrl);
if(sign == LV_SIGNAL_COORD_CHG) {
if(lv_page_on_edge(page, LV_EDGE_xxx)) {
/* do what you want */
}
}
return res;
}
old_page_scrollable_signal = lv_obj_get_signal_cb(lv_page_get_scrollable(page));
lv_obj_set_signal_cb(lv_page_get_scrollable(page), custom_page_scrollable_signal);
Yes, instead I choose to more modern and faster “elastic scroll”. Do you think the edge flash is also important? I haven’t seen it for a while on mobile and web.
I think Maybe the description of my problem is not clear enough. In my project, the LABEL was created on the PAGE to display a TEXT, and the scroll of the PAGE was controlled by the button without using LV_INDEV. I hope to change the TEXT on the LABEL when scrolling to the top and bottom.It is similar to a drop-down refresh page on a mobile phone APP.