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

Java Development

Reply
Trusted Contributor
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

horizontal scroll problem in touch screen

I defined 7 vertical managers witdth  of 640 in a horizontal field of dimensions 640x300. when i am scrolling in a touch screen i want the each vertical manager to come in screen on a single scroll not half part. Can any one tell me

how  to make the entire individual vertical manager to be in focus in one time of scroll.

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: horizontal scroll problem in touch screen

It seems you want to 'centre' the VFM on the screen when you scroll horizontally.

 

You can do this using your own Thread and actively listening for scroll events, then using set HorizontalScroll to move the Fields into the correct position. 

 

However an easier way of doing this is to set the focus on VFM you want centered.  As long as you have something in the VFM which accepts focus and is full width, then the framework will try to display all of it, which means it will scroll and stop at a point this Field is in focus.

 

I think you could do this with a sort of NullField which did not display focus, had a full width and 1 pixel height. 

Please use plain text.
Trusted Contributor
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: horizontal scroll problem in touch screen

i kept the nulllabel field it is working fine in non touch screen....when comes to touch if i am moving horizontallly without using traceball...then my half of the null field is coming in screen

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: horizontal scroll problem in touch screen

Sorry missed that step.

 

When you swipe, focus is not moved.  So you have to do it.  One way is to have a scroll listener.  When the scroll listener detects a scroll movement, it waits until the scroll changes stop happening. Then it figures out which VFM should be in the center, and sets focus on that. 

 

That is easy to explain, not so easy to do,  I've seen this done with a Thread, but perhaps you can do it with a Timer. 

 

You may have some issues with determining which Field in the VFM should get focus, unless you always scroll to the top. 

Please use plain text.
Trusted Contributor
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: horizontal scroll problem in touch screen

i tried a lot by keeping different conditions in scrolllistener but it not giving the output what i want. Please tell me some hint to do this.

Please use plain text.
Trusted Contributor
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: horizontal scroll problem in touch screen

I check the touch device where i open the blackberry app world and select the games option. There on the screen we have list of options horizontally like "category", "topratings ".

here when i am scrolling horizontally according to the topheadings the below part in moving.

I also want the same functionality in my app....can any one tell me how to implement this.

 

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: horizontal scroll problem in touch screen

[ Edited ]

If you want to do something like App World, I suggest you look at developing for OS 6.0 and above only. I believe PaneManagerView does what you want.  I have never tried to use this class or the associated classes since I still developing for OS 5.0. 

 

I suggest that developing something like PaneManagerView yourself would be very hard, because you are not that familiar with how the BlackBerry UI works. But I think you would start by doing what we are doing here using ScrollChangeListener. 

Please use plain text.
Trusted Contributor
sowjanya1919
Posts: 109
Registered: ‎08-21-2012
My Device: Blackberry curve
My Carrier: company

Re: horizontal scroll problem in touch screen

Thankyou. My app is for os7 ...so i will try panmanager as u said ...any useful information if you have about this please

share with me..it will be helpful for me

Please use plain text.
Developer
peter_strange
Posts: 19,601
Registered: ‎07-14-2008
My Device: Not Specified

Re: horizontal scroll problem in touch screen

As noted, never used it.  I suggest you create a simple standalone example and make sure it works for you.  Then if you have problems, you will be able to post the code here.

 

Please let us know how you get on.

 

Good luck. 

Please use plain text.