2021-11-16 06:33 AM
Hi,
In a touchgfx based UI. I have a scroll list that has more than 5 items for displaying on the screen, but at a time only 4 scroll list items can be displayed on the screen. For reference, I have provided a snapshot of the screen.
Push-button interfacing is for screen navigation, as it is not a touch-based screen.
How can I scroll the list vertically down so that it can display the other scroll list items?
2021-11-16 08:00 AM
This becomes a difficult task because evaluating a simple keystroke does not allow many choices. But you want to scroll up and down, probably select and confirm, so you want to do at least four functions with just one button, right?
You could e.g. long press, short press, double long press, twice short press - but that's not intuitive, is it?
Did I understand the question correctly?
Regards
/Peter
2021-11-16 11:00 PM
Hi Peter,
Thanks for the quick reply.
[Peter] But you want to scroll up and down, probably select and confirm, so you want to do at least four functions with just one button, right?
[MR] want to scroll up and down, but how to select and confirm. Can you provide which API/function need to call?
[Peter] You could e.g. long press, short press, double long-press, twice short press - but that's not intuitive, is it?
[MR] module has multiple button interfacing, no long-press is required.
2021-11-17 01:10 AM
I do this with push-buttons in my project and here is the short version of how I do this.
I'm using Scrollable Container with custom containers. And my custom container have a flex button and extra text lines.
I use the flexButton.setPressed(true/false) to "highlight" one item at the time when using up/down push buttons.
To scroll items in the Scrollable Container I use scrollableContainer.doScroll(X,Y) (this requires TouchGFX V4.18.0).
2021-11-23 04:11 AM
You can do it with the animateToItem() function. In order to do so, you've to retrieve all currently visible items (through the function getItem()) and determine what is the index of the bottommost item. Then you just do animateToItem(bottommost_item + 1).
However, you've to know that the scrollList wasn't really designed to be manipulated that way and I would recommend you to use the scrollContainer instead.