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

Native Development

Reply
Regular Contributor
Guillaume_LACHAUD
Posts: 60
Registered: ‎12-19-2012
My Device: BB10 Alpha B
My Carrier: SFR

ListView : how to get notify when current item has changed when in SnapMode

[ Edited ]

Hi !

 

I have a ListView whom Layout orientation is from Left to Right. I also have set these two properties :

 

snapMode: SnapMode.LeadingEdge
flickMode: FlickMode.SingleItem

 

The result is a nice ViewPager like in Android. I would now like to be notified when the user has swiped to a new page.

 

Unfortunately, none of the signals seems to be emitted when the ListView has gone from item i to item i+1

 

EDIT : in a short way : I am looking for the equivalent of onCurrentItemChanged that we had in QtQuick

 

Any idea ?

Please use plain text.
Regular Contributor
Guillaume_LACHAUD
Posts: 60
Registered: ‎12-19-2012
My Device: BB10 Alpha B
My Carrier: SFR

Re: ListView : how to get notify when current item has changed when in SnapMode

I will try to do it differently

 

I know how many items I do have in my ListView. I know the width of one item. So I can calculate the total width of the ListView. If I can get access to the scroll position, I can then decide ich item is currently displayed.

 

Is there a way to know the current scroll position through a signal ?

 

Thanks

Please use plain text.
Regular Contributor
Guillaume_LACHAUD
Posts: 60
Registered: ‎12-19-2012
My Device: BB10 Alpha B
My Carrier: SFR

Re: ListView : how to get notify when current item has changed when in SnapMode

[ Edited ]

Found solution : http://supportforums.blackberry.com/t5/Cascades-Development/ListView-which-items-are-currently-visib...

 

EDIT : not working as expected, still looking for a solution

Please use plain text.
Developer
nareshkodumuri
Posts: 125
Registered: ‎04-28-2012
My Device: BlackBerry 9800
My Carrier: BlackBerry

Re: ListView : how to get notify when current item has changed when in SnapMode

Hi,

 

    If u get the indexpath for the current visible list item in the list view please provide the sample .

 

 

Regards,

Naresh Kodumuri.

Please use plain text.
Regular Contributor
Guillaume_LACHAUD
Posts: 60
Registered: ‎12-19-2012
My Device: BB10 Alpha B
My Carrier: SFR

Re: ListView : how to get notify when current item has changed when in SnapMode

[ Edited ]

Any idea ? This deems to be pretty basic struff for a component like this.

Please use plain text.