@Override public void onLoad() { if (_isInitialLoad) { _isInitialLoad = false; } DragController.get().addDragEventsHandler(this); DragController.get().addSwipeEventHandler(this); }
@Override public void onDragStart(DragEvent e) { int matrix = getMatrixY(getWidget().getElement()); int current = getTranslateY(getWidget().getElement()); if (current != matrix) { // scroll on going setTransitionDuration(getWidget().getElement(), 0); int diff = current - matrix; int offset = diff > 2 ? 2 : diff > -2 ? diff : -2; setTranslateY(getWidget().getElement(), matrix + offset); DragController.get().suppressClickEvent(); } else { setTransitionDuration(getWidget().getElement(), 0); } }
@Override public void onDragEnd(DragEvent e) { DragController.get().releaseDragCapture(this); }
@Override public void onDragStart(DragEvent e) { DragController.get().captureDragEvents(this); int value = computeNewValue(e); setValue(value); }
@Override public void onUnload() { DragController.get().removeDragEventsHandler(this); }
@Override public void onLoad() { super.onLoad(); DragController.get().addDragEventsHandler(this); }
@Override protected void onUnload() { DragController.get().removeSwipeEventHandler(this); super.onUnload(); }