Examples of GestureUtility


Examples of org.jboss.errai.ui.cordova.events.touch.GestureUtility

        return storeBinder.getModel();
    }

    @PostConstruct
    public void init() {
      final GestureUtility gestureUtility = new GestureUtility(this);
      gestureUtility.addLongTapHandler(new LongTapHandler() {
        @Override
        public void onLongTap(LongTapEvent event) {
          switchMode();
        }
      });
      final Style style = StoreWidget.this.getElement().getStyle();
      gestureUtility.addSwipeMoveHandler(new SwipeMoveHandler() {
        @Override
        public void onSwipeMove(SwipeMoveEvent event) {
          int distance;
          switch (event.getDirection()) {
            case LEFT_TO_RIGHT:
              distance = event.getDistance();
              break;
            case RIGHT_TO_LEFT:
              distance = -event.getDistance();
              break;
            case TOP_TO_BOTTOM:
            case BOTTOM_TO_TOP:
            default:
              distance = 0;
          }
          style.setLeft(distance, PX);
        }
      });
      gestureUtility.addSwipeEndHandler(new SwipeEndHandler() {
        @Override
        public void onSwipeEnd(SwipeEndEvent event) {
          if (event.isDistanceReached()) {
            deleteThisStore();
          }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.