Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 163
Registered: ‎04-28-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

How to check whether list is scrolling up or not?



    I want to check whether list is scrolling up or down.I am using ListScrollStateHandler + atEnd property to check whether the list is at the end or not.At end if i scroll up i want to download images and if it is down i won't do anything. please provide me the solution.



Naresh Kodumuri.

Posts: 174
Registered: ‎03-05-2009
My Device: Dev Alpha
My Carrier: -

Re: How to check whether list is scrolling up or not?

you can simply handle the touch() event on the list view to detect the scroll direction?




 //event.windowY(); //store y position as it moves and detect whether y-difference is negative or positive for scrolling direction




i'm not sure of the reason why you need this, but if you are downloading thumbnails for your list items, you might want to look at this sample:


the ListView handles the async loading pretty well (even with the images as shown in the sample), so no need to re-invent the wheel Smiley Happy

Posts: 293
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: How to check whether list is scrolling up or not?

The ListScrollStateHandler tells you if the list is scrolling or not, but doesn't seem to provide the direction:




I would put a LayoutUpdateHandler inside the ListItemComponent for the listview, and detect changes in the layoutFrame.y property