cancel
Showing results for 
Search instead for 
Did you mean: 

How to move scroll list through a push button.

MRafa.1
Associate II

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.

0693W00000GXl2nQAD.pngPush-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?

4 REPLIES 4
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
MRafa.1
Associate II

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.

Svenn Dahlstrom
Associate III

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).

GMeur
Senior

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.