Infinite scroll for the Page object

Description

What MCU/Processor/Board and compiler are you using?

ESP32 + ESP-IDF v4.0 release
Custom board
Xtensa32 compiler

What do you want to achieve?

I want to implement a continuously scrolling horizontal menu, where each element is represented by an icon. By continuous I mean that when you reach the last menu element, you can then seamlessly switch to the first element (infinite scroll option).

What have you tried so far?

I am using Page object with 12 icons and scroll function to switch between the icons. When I reach the last element, I use the same scroll function but with animation disabled to go back to the first element. So I was wondering if there is a better way of doing this, as the difference in scroll effect with and without animation is quite noticable

Infinite scrolling is not supported by the page object right now. It’s difficult to support for generic containers like pages because you need a way to draw the same logical object in two visual locations.

Maybe the roller object would work for what you need; it supports infinite scrolling. If your icons are symbols in a font then it should work for you.

Hi, thanks for your reply.
Unfortunately, I do not think that roller object will work for me as my icons are PNG images. As I understand, there are no plans of adding this in any of the upcoming versions of lvgl?

Not at the moment. It adds additional complexity to the rendering, because you need the top of the page to also appear at the very bottom (if you get my meaning).

2 Likes