I have a web app I'm creating, where I need to allow the user to swipe between pages. From what I've been researching you need to use MGWT (mobile Google web toolkit -- http://code.google.com/p/mgwt/)
Then you have to create a class that extends a Panel class and implements MGWT's "HasTouchHandlers" interface:
(http://code.google.com/p/mgwt/source/browse/mgwt/src/main/java/com/googlecode/mgwt/ui/client/widget/touch/TouchPanel.java?name=v1.0.0-alpha1)
Also your Panel should implement GWT's AnimatedLayout interface (such as LayoutPanel, DockLayoutPanel, and SplitLayoutPane), so you can natively slide the Panel after intercepting the touch event.
My question is can any one point me to a tutorial or example code on how to do this? Or how layout a GWT project in terms of Panels? For example, if I have multiple pages in my app do I have multiple Panels? thanks - Mike
Move between other apps in full screen: Swipe left or right on the trackpad with three or four fingers, depending on how you set your trackpad preferences.
To swipe between pages on a Mac with a trackpad, place two fingers on the trackpad and swipe them left or right. If you're using a Magic Mouse, place a single finger on it and swipe it left or right.
Tap the Settings button next to Gesture navigation to change the sensitivity of the screen to the Back swipe gesture. If you find that gestures aren't being recognised, use the Left edge and Right edge sliders to turn the sensitivity upwards. If you're using gestures unintentionally, turn the sensitivity down.
mgwt now has support for swipes. There is a swipe recognizer as well as a swipe panel:
See it in action: http://mobilegwt.appspot.com/showcase/#CarouselPlace:
Here is the code: http://code.google.com/p/mgwt/source/browse/src/main/java/com/googlecode/mgwt/ui/client/widget/Carousel.java
I prefer that you use iScroll for swipe because it works without any issues on Android as well as iOS Browsers. The Implementation will also work on 3rd party browsers like Diigo or Dolphin. With this you i think you can completely avoid using the mgwt API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With