Skip to main content
JonB
Visitor II
Dec 17, 2018 6:59 PM UTC
Solved

Override ScrollList scrolling

Is it possible to override a ScrollList so that list scrolling is controlled by a separate widget? This separate widget is on the same screen as the ScrollList, but is outside of the ScrollList. I would still like to be able to use normal press & release on the Items inside the ScrollList.

In other words, I do not want to allow the user to scroll the ScrollList by dragging on the ScrollList itself.

If that is possible, exactly what would need to be overridden to accomplish that?

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Dec 21, 2018 9:00 AM UTC

Hi @JonB​ !

The class ScrollBase has a virtual method animateToItem(int16_t itemIndex, int16_t animationSteps) that you could call on your ScrollList to animate to a specific item in your list.

Hope that helps!

Best regards,

Martin

3 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Dec 21, 2018 9:00 AM UTC

Hi @JonB​ !

The class ScrollBase has a virtual method animateToItem(int16_t itemIndex, int16_t animationSteps) that you could call on your ScrollList to animate to a specific item in your list.

Hope that helps!

Best regards,

Martin

Sandy.Dahl
Associate III
Oct 9, 2019 11:04 AM UTC

Hi @Martin KJELDSEN​ !

Do you have a corresponding method (animateToItem) for scrollable containers?

Kind regards

Sandy

Martin KJELDSEN
Principal III
Oct 10, 2019 7:43 AM UTC

It doesn't seem to be the case - It's different for scrollable container because you do not have list elements in the same way. You could probably adapt the code from ScrollList and do it yourself :)

/Martin