cancel
Showing results for 
Search instead for 
Did you mean: 

Override ScrollList scrolling

JonB
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

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

View solution in original post

3 REPLIES 3
Martin KJELDSEN
Chief III

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 II

Hi @Martin KJELDSEN​ !

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

Kind regards

Sandy

Martin KJELDSEN
Chief III

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