05-17-2011 12:18 PM
I've developed an app using Google Web Toolkit, then re-packaged into a WebWorks application using bbwp. My problem is the inconsistent behavior of the onswipedown call. Actually, all this code is in the HTML file, and so GWT ought not to play a part in it, but I mention it for completeness. Here is are some code fragments, based on an article by Adam Stanley:
The function setHandlers is called onLoad, and it registers the onSwipeDownCallback to the onSwipeDown event. When you swipe down, the class of the menuBar is changed to showMenuBar, and the CSS (not shown here) transitions the div so that it rolls down from the top.
Here's the weird part. It works some of the time.
If it never worked, then I'd be happily debugging. But some of the time?? It seems to either always work or never works. In other words, when I start the app, and the menu refuses to appear on the swipe down, then it never appears. I close the app, and restart it. Fails again. I close the app, and restart it. It works! And it will work every time I swipe down. I close the app, and restart it. Stops working.
Another weird clue. I get the same behavior on the simulator. Works or doesn't work.
Any clues? Anyone ever have this sort of strangeness using blackberry.app.event?
Here is the code from the config.xml file that refers to the API:
<content src="Viewer.html" />
<feature id="blackberry.ui.dialog" />
<feature id="blackberry.app" />
<feature id="blackberry.app.event" />
05-18-2011 02:25 PM