cancel
Showing results for 
Search instead for 
Did you mean: 

Some wrong actions in ScrollList Widget.

xchen.1480
Associate II

I'm using ScrollList in my TouchGFX project, but there are 2 problems:

1, After setWindowSize(n), when n is not 1, the itemSelected in

void scrollTopItemSelectedHandler(int16_t itemSelected) have a wrong value.

As described in the following 2 tips:

https://community.st.com/s/question/0D53W000003KJ4MSAW/how-to-keep-the-last-item-of-a-scroll-list-keep-at-the-bottom-of-list-not-solved-yet-when-using-setwindowsize-there-are-some-error-please-help-me-

https://community.st.com/s/question/0D50X0000B7ZL90SQG/problem-with-itemselectedcallback-scroll-list

2, When setWindowSize(1), and scrollList.setSnapping(false), the itemSelected always right in each selection;

but if scrollList.setSnapping(true), the itemSelected will move left a half item.

0693W000001ce2lQAA.png

How to solve these two problems?

Is there some bug in ScrollList, or am I using it wrong?

14 REPLIES 14
Alexandre RENOUX
Principal

Hello,

Did you set the list as Circular ? If it's the case, you should not call setWindowSize() as this only applies to non-circular lists.

Regarding the behavior when calling scrollList.setSnapping(true), I am not too familiar with snapping because I didn't code it but I think it's normal.

What are you trying to do ? If you want to have an item selected in the center, maybe a scrollWheel is more appropriate.

/Alexandre

Hello,

In my project, a list to show a group of items(similar view), eg: menu , records, user names, ...

These items always can into a detailed view when clicked.

menu -> setting 1

_________setting 2

_________language -> chinese

______________________english

​_________records -> Records 1 -> Time: 20200526 11:30:30

__________________________________Name: Tom

__________________________________xxxx: ......

_____________________Records 2 -> Time: 20200526 12:30:30

___________________________________Name: Jerry

___________________________________xxxx: ......

As shown in the application scenario above, the number of items often change.

Personally think that ScrollList is more suitable than other widgets.

These ScrollLists are not circular, because my users and I want the list to have an end,

and want the screen can filled by items, when scroll to the end, not only one item is shown in the top of screen.

When setWindowSize(1) and setSnapping(true) (both Circular and not Circular ), the paramter itemSelected of void scrollTopItemSelectedHandler(int16_t itemSelected), is not in the right position.

itemSelected = 0, when clicked on the left part of ITEM 0.

itemSelected = 1, when clicked on the right part of ITEM 0 and left part of ITEM 1.

itemSelected = 2, when clicked on the right part of ITEM 1 and left part of ITEM 2.

...

In this case, I'll not know which item is clicked when itemSelected = 0, or 1, ...,

then I'll not know which view to switch to.

This is my question 2 in my tips.

Question 1:

Prerequisites: setWindowSize(n) , n>1. setSnapping(false), Circular is disabled

IF ScrollList is not show the last n items, itemSelected is right value when click items.

IF any one of last n items is scrolled into the view,

Eg: number of items is 5, n is 3. Not scrolled to the end:

________________________When Clicked

__________ITEM 0

-----------------------------

__________ITEM 1_______ itemSelected = 1

__________ITEM 2_______ itemSelected = 2

view: __ITEM 3________ itemSelected = 2

-----------------------------

__________ITEM 4

Eg: number of items is 5, n is 3. Scrolled to the end:

________________________When Clicked

__________ITEM 0

__________ITEM 1

-------------- ---------------

__________ITEM 2 _______itemSelected = 2

view: __ITEM 3 ________itemSelected = 2

__________ITEM 4 ________itemSelected = 2

-------------------------------

Hope my detailed description is easy to understand.

Hello,

Thank you for your detailed description. I now understand your issue and I was able to reproduce it.

It's highly possible that these are 2 bugs of the ScrollList. I notified the team and we will try to investigate and schedule a fix as soon as possible.

Sorry for the inconvenience,

/Alexandre

rzapp
Associate II

Hi @Alexandre RENOUX​ 

are already some news about this bug? I encountered exactly the same issue.

Thanks for your answer

Cheers

rosario

Hi Rosario,

The bug has been fixed by the team. It's going to be integrated soon.

I will come back to you when it's ready to be used.

/Alexandre

Alexandre RENOUX
Principal

Hello,

The fix will be integrated in the next version of TouchGFX Designer 4.14 which will normally arrive first half of July.

In the meantime, you can use the modified files enclosed.

Replace the Scrollers/ folder at this location: <your project>\touchgfx\framework\source\touchgfx\containers with the enclosed Scrollers/ folder.

Tell me if it fixes the issue.

/Alexandre

Thanks a lot for the fast solution!

perfect thanks, it works as expected.

/rosario

Hello,

Thanks for your solution.

But when I replaced the folder, nothing changed​. There is not any new compilation information about these files.

It seems like the VS simulator and MDK project used a library, not the new c++ source files.

How to let the project to use these new files?

PS: The TouchGFX version is V4.12.3

Hello,

First, if possible, try to update TouchGFX to the last version 4.13.0.

Are you sure you changed the correct folder ? Because just changing the files should work because it's exactly the same files just with a few changes to fix the bug.

Try to run the simulator to see if the bug is removed first before trying on Keil or Visual Studio. For Rosario it seems to have worked perfectly as expected. You might have done something different.

/Alexandre