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

Web and WebWorks Development

Reply
Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

PlayBook: Detecting SWIPE_DOWN event using WebWorks

[ Edited ]

Hello,

 

Has anyone figured out how to detect a swipe or any other gesture event on the PlayBook using WebWorks?

 

I'd like to get a toolbar into my app.

 

Thanks!

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Silaryn
Posts: 37
Registered: ‎12-24-2010
My Device: Tour

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

I found that article too (great one by the way) but detecting touch events only works on the screen and does not extend to the bezel around the PlayBook.

 

I was looking for a way to implement a toolbar when a user swipes down from the bezel into the screen. This approach would follow UI guidelines for apps on the PlayBook.

 

Thanks!

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

Jerome,

 

That is a fantastic requirement, thanks for bringing it to our attention.  I have sent your note to Product Management for consideration.

 

To help reinforce the need for this effort, would you kindly submit a feature enhancement request using the Developer Issue Tracker?  Having more people see/vote on it will help prioritize this request.

 

Cheers!

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
jmace
Posts: 482
Registered: ‎10-24-2008
My Device: 9300

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

JCarty,

 

I haven't had any time to fool around with the Playbook WebWorks SDK, but if I get a chance to I'll experiment with that and see if it is possible.

_________________________________________
www.jasonmace.com/blackberry
Developer
JCarty
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

Added but forgot to mention that it's for the PlayBook.

 

https://www.blackberry.com/jira/browse/WEBAPI-100

 

Jason:

 

I don't think it's built in and might be something RIM has to do on their side. If you find a workaround, let me know.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Regular Visitor
welshdave
Posts: 1
Registered: ‎03-20-2011
My Device: .

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

Looks like the latest release has given us the Swipe Down event.

 

This works for me:

 

Include <feature id="blackberry.app.event" version="1.0.0"/> in your config.xml.

 

 

function test(){
  alert('test');
}

blackberry.app.event.onSwipeDown(test);

 

 

Firebug lite seems to break it, so make sure you aren't using that.

Developer
Concession
Posts: 31
Registered: ‎03-06-2011
My Device: Not Specified

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

They did add swipe_down in the latest update, and on the 15th it was in the documentation, and I can confirm it works.


Strange thing is that yesterday they actually removed it from the documentation, http://www.blackberry.com/developers/docs/webworks/api/playbook/ , it used to be under application events, but it is not there anymore, so I'm not sure how stable the API is.

 

I've been able to consistanly make the simulator no longer respond to swipe down events by using an i-frame, so I'm pretty sure they are still working out the kinks in the api.

 

Because of that, I'm not sure how safe it is to use in an actual application, I probally will submit my apps with it included since it is such a critical feature for the OS, but hopefully they'll bring it back to the official documentation with the next SDK update.

Developer
ddluk
Posts: 212
Registered: ‎10-02-2010
My Device: Z10 and Z30

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

RTM version of WebWorks have that event:

 

 

<func name="onSwipeDown" static="true" returns="void" comment="Assigns a listener for when the application goes to the foreground.">
				<details>Only one function can be assigned to this event. To unregister the callback simply call the onSwipeDown method and pass in null for the callback parameter. 
						This event is dispatched when a user swipes down from the top bezel of the device onto the screen.
				</details>
				<param name="callBack" type="String"
					comment="Function to be called when the swipe down action occurs." />
			</func>
			<func name="onSwipeStart" static="true" returns="void" comment="Assigns a listener for when the application goes to the foreground.">
				<details>Only one function can be assigned to this event. To unregister the callback simply call the onSwipeDown method and pass in null for the callback parameter. 
						This event is dispatched when the user starts a swipe from the top bezel of the device.
				</details>
				<param name="callBack" type="String"
					comment="Function to be called when the user starts a swipe from the top bezel of the device" />
			</func>

 You can find it on github: https://github.com/blackberry/WebWorks-TabletOS/blob/rtm/js_api/BlackBerry_Application_Events/librar...

 

Developer
Concession
Posts: 31
Registered: ‎03-06-2011
My Device: Not Specified

Re: PlayBook: Detecting SWIPE_DOWN event using WebWorks

Nice, I didn't notice the Webworks project on github was updated to include the Tablet SDK.

 

 

I guess if the function is there in in all of its glory it's safe to use.