smooth scrolling
This commit is contained in:
@@ -132,7 +132,9 @@ static void scroll_timer_cb(lv_timer_t *timer)
|
|||||||
cur_y = 0;
|
cur_y = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_obj_scroll_to_y(tbl_services, cur_y + s_row_h, LV_ANIM_OFF);
|
// lv_obj_scroll_to_y(tbl_services, cur_y + s_row_h, LV_ANIM_OFF);
|
||||||
|
const int delta_y = s_row_h / 8;
|
||||||
|
lv_obj_scroll_to_y(tbl_services, cur_y + delta_y, LV_ANIM_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Measure row height, compute visible rows, append duplicates for seamless loop */
|
/* Measure row height, compute visible rows, append duplicates for seamless loop */
|
||||||
@@ -281,8 +283,8 @@ static void create_main_section(lv_obj_t *parent)
|
|||||||
lv_table_set_cell_value(tbl_services, i, 1, "---");
|
lv_table_set_cell_value(tbl_services, i, 1, "---");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Auto-scroll timer: 2 second period */
|
/* Timer for each shift of 1/8 line's height */
|
||||||
s_scroll_timer = lv_timer_create(scroll_timer_cb, 2048, NULL);
|
s_scroll_timer = lv_timer_create(scroll_timer_cb, 200, NULL);
|
||||||
|
|
||||||
/* === Left column: Pi Vitals (below services) === */
|
/* === Left column: Pi Vitals (below services) === */
|
||||||
int rx = 0;
|
int rx = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user