Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT Swipe between Pages / Panels

Tags:

swipe

gwt

panel

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

like image 333
Mike6679 Avatar asked Feb 24 '12 16:02

Mike6679


People also ask

How do I swipe between full screen applications on Mac?

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.

How do I swipe between pages and mouse on Mac?

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.

How do I set my android back to swipe?

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.


2 Answers

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

like image 114
Daniel Kurka Avatar answered Sep 25 '22 10:09

Daniel Kurka


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.

like image 33
Vijay Sarin Avatar answered Sep 24 '22 10:09

Vijay Sarin