Welcome!

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

Adobe AIR Development

Reply
Highlighted
Developer
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook
My Carrier: -
Accepted Solution

QNX List scroll

Hello,

  I'm studying the QNX components in order to check/improve performances of my Spark app. (This is for the background).

So I'm trying to use the List scrollToIndex method in order to put in view a new item added to the list:

myList.scrollToIndex(newIndex);

 

But this doesn't work for now.... I have no animation, and the new item is not in view.

(I check item status using:  myList.getIsCellVisibleAtIndex(newIndex) )

 

Anybody would know how to use this method in order to have a smotth animation of the list ?

JC
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: QNX List scroll

I tried to use this in 0.9.2 of the SDK and it did not work then, so I just commented that part of my code out. I guess they have yet to get around in fixing it. You might want to submit a bug report with sample code to reproduce it if you really need it.
Developer
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook
My Carrier: -

Re: QNX List scroll

Thank you for the answer jtegen,

  my sample code would not be optimal for a bug report, because I use a QNX list inside a Flex Spark project (not pure as3)...

 

So QNX list animation is not working... too bad. I guess we have to use custom classes again.

(Note that it was the same problem with Spark List: I had to customize the class to have a smooth animation.)

New question: is there a way to retrieve the scroll position of a QNX list ? What is the "scrolling" object ? (for Spark list it's the dataGroup)

JC
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: QNX List scroll

You cannot get the scroll position of the QNX list. Would make life easier if you could. I had to place the QNX List in a ScrollPane with the list always as tall as all the items in it. The ScrollPane has scroll offsets.
Developer
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook
My Carrier: -

Re: QNX List scroll

Ah yes, I found your ScrollPane post about it.

So you managed to have the List manually scrolled to where you want this way ?

 

For now I try to understand how works List.__scrollMgr. It looks like this is what handle the scrolling.

But I got it null when I use it directly ...

JC
Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: QNX List scroll

Yes, it seem to work better. The problem is the list methods that is suppose to report what is first visible, etc are not reliable.
Developer
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook
My Carrier: -

Re: QNX List scroll

I made a lot of tests with the List for now:

 so I have the list scrolling but without the items being refreshed...

 or the items refreshed, but with no scroll... : )

This is getting on my nerves !! I think I will try the ScrollPane then...

JC
Developer
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook
My Carrier: -

Re: QNX List scroll

Hello,

  I would like to know if someone managed to use the QNXList automatic scrolling functionnalitites by now ?

Or is it a definitive bug ... ?

 

JC
Developer
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook
My Carrier: -

Re: QNX List scroll

Finally working !

Short story: I was preparing a BUG-report, my sample was not working as expected, and suddenly after set/reset some parameters, the list scrolled smoothly like a charm !

So I don't know what is/was the problem, but I could apply a workaround which consists to use a dummy Timer (1 ms is enough), in order to give enough time to the Tweener to be "aware" of the new List content:

-update dataprovider

-wait (1ms)

-invoke scrollToIndex()

(I don't like using Timer to randomly "wait" but... works fine here)

 

I don't know if this will work for all cases, and I still don't know if it's a bug, or if it is about the way I use QNX List inside a Spark project (using Renaun's QContainer), but the workaround is easy, and the result is very nice (as expected !) (thanks to the QNX library).

JC
Developer
Posts: 425
Registered: ‎03-17-2011
My Device: Developer
My Carrier: Telus

Re: QNX List scroll

Thank you very much Acenet!

 

This technique works with scrollIndexVisible as well!

_________________________
In the dark and need a sky map?
Discover What's up at App World.
Follow What's up on Facebook