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
Contributor
Posts: 18
Registered: ‎05-02-2011
My Device: Torch 9800
My Carrier: Airtel

Pinch Gesture for Strom 2 (Blackberry OS 5)

Hi,

I'm working with pinch gestures. The BB SDK supports pinch gestures from Blackberry OS 6 (viz. TouchGesture.PINCH_BEGIN,TouchGesture.PINCH_UPDATE and TouchGesture.PINCH_END events via TouchEvent).

How can I get such event notifications in Blackberry OS 5 (Strom 2)?

Developer
Posts: 16,986
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Pinch Gesture for Strom 2 (Blackberry OS 5)

you can't, that's why they are supported since 6.0
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Contributor
Posts: 18
Registered: ‎05-02-2011
My Device: Torch 9800
My Carrier: Airtel

Re: Pinch Gesture for Strom 2 (Blackberry OS 5)

Is there any other alternative?
I want to implement image zooming in an app that'll support OS 5 and above. Due to time limitation, I'm creating a single app with OS 5 API, hence I cannot use PINCH events. But for touchscreen devices such as Torch, I think the natural way to zoom would be by pinching.
So how should I proceed? Any suggestions?
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Pinch Gesture for Strom 2 (Blackberry OS 5)

Thinks like "TouchGesture.PINCH_BEGIN" are just magic numbers, so you just code the number correctly, or perhaps better, use some sort of constant that has the correct value.  You can find the values youneed in the JavaDocs.

 

But as soon as you start trying to make OS 6.0 specific method calls, things start getting impossible.  In which case you need two builds. 

Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Pinch Gesture for Strom 2 (Blackberry OS 5)

You could still listen for touch events, and then identify the pinch gestures yourself. Of course this is not easy.


Read my thoughts on BlackBerry Development at news.ebscer.com
Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Pinch Gesture for Strom 2 (Blackberry OS 5)

I wrote this a while ago, but it isn't perfect and requires changing the logic you are using to handle touch results.

 

It also doesn't do rotation or work on non-touchscreen devices just yet.

 

UI events are individual function calls instead of one large one.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.