Skip to main content
JonB
Visitor II
December 17, 2018
Solved

Override ScrollList scrolling

  • December 17, 2018
  • 3 replies
  • 828 views

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.
Best answer by Martin KJELDSEN

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
December 21, 2018

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
October 9, 2019

Hi @Martin KJELDSEN​ !

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

Kind regards

Sandy

Martin KJELDSEN
Principal III
October 10, 2019

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