Hammer GWT Support for Touch Event

248 views
Skip to first unread message

Velusamy Velu

unread,
Sep 7, 2019, 3:57:24 PM9/7/19
to GWT Users
This is a continuation of my post yesterday on almost the same topic. Having failed to handle com.google.gwt.event.dom.client.TouchMove I attempted to use Hammer GWT. Pretty much this also failed me. I could see it handling org.geomajas.hammergwt.client.event.EventType.TAP, org.geomajas.hammergwt.client.event.EventType.SWIPE, org.geomajas.hammergwt.client.event.EventType.SWIPERIGHT, org.geomajas.hammergwt.client.event.EventType.SWIPERIGHT and occasionally org.geomajas.hammergwt.client.event.EventType.DOUBLETAP. So, I'm pretty much in the same soup as I was before. Here's the sample code.

import staticorg.geomajas.hammergwt.client.event.EventType.*;

HammerTime hammerTime = HammerGwt.create(drawingPaper);
HammerGwt.on(hammerTime, new HammerHandler() {

  @Override
  public void onHammerEvent(NativeHammerEvent event) {
    EventType eventType = event.getType();
    MaterialToast.fireToast(eventType.toString(), 5000);
  }
}, DOUBLETAP, DRAG, DRAGDOWN, DRAGEND, DRAGLEFT, DRAGRIGHT, DRAGSTART, DRAGUP, GESTURE, HOLD,
    PINCH, PINCHIN, PINCHOUT, RELEASE, ROTATE, SWIPE, SWIPEDOWN, SWIPELEFT, SWIPERIGHT, SWIPEUP,
    TAP, TOUCH, TRANSFORM, TRANSFORMEND, TRANSFORMSTART);

As in my earlier post I'm using browsers like Chrome, Firefox, Duck Duck Go, Bravo, Opera, and Opera Mini on my Pixel 2 and Samsung Galaxy Tab A.

Any suggestions would be very much appreciated.

Thank You

Frank

unread,
Sep 9, 2019, 4:12:45 AM9/9/19
to GWT Users
Try using the ahome wrapper instead of the geomajas wrapper: https://github.com/ahome-it/ahome-hammer

Velusamy Velu

unread,
Sep 9, 2019, 1:46:17 PM9/9/19
to GWT Users
Hi Frank:

I appreciate your suggestion. Is there a jar for it in the maven rep? Please let me know.

Thank You
--v

Frank

unread,
Sep 10, 2019, 5:59:02 AM9/10/19
to GWT Users
I don't think so.
I would just copy the code into your own project.
Reply all
Reply to author
Forward
0 new messages