05-13-2013 06:17 AM
Hi every one
I have a list of images with some text and button ,i am addint it in to a single vertical manager and that vertical manager i am adding in to horizontal manager with horizontal scroll feature. it is working fine with roll over button while i am scrolling it Horizontaly.
But my problem is with touch screen device, if i am scrolling a little left side it by touching it should apear whole next right side list view,But it is not happening.it is appearing how much i am scrolling it by touching.
How to make it scroll fully like roll over button.
05-13-2013 01:10 PM
I assume when you say rollover button, you are talking about the trackpad.
The trackpad works how you want it to because it moves focus. Swiping does not change focus. So you need to find some mechanism to simulate this. This is not easy if you want the user to be able to swipe multiple items in the HorizontalFieldManager. It is also complicated by the fact that the HFM might not have focus anyway.
For now assume you want to move one Field at a time.
Implement a scroll change listener. When this is invoked, check to see if the HFM is in focus. If not,then find out which field is currently being scrolled using <manager>.getFieldAtLocation(). If it is in focus, find out which field has focus using getFieldWithFocusIndex. Them wait for the next scroll indication. If the scrolling is moving to the left, then set focus on the Field before the one you calculate a above, If to the right, then the one after. Now logically disable your scroll change listener for a second to let things settle down. Then re-enable and go through the checks I described above with the next scroll change.
This is not a full description of the requirements, but is intended to be enough to get you going. You will find you need to do some thinking yourself to figure out what is actually going on. Then you might want to change this processing to match what you really want. But hopefully this will give you the background you need.