public class SwipeGestureEventHandler extends AbstractDragGestureEventHandler
| Modifier and Type | Class and Description |
|---|---|
static interface |
SwipeGestureEventHandler.Callback
Defines the interface, a class, which should be notified about the events of a
SwipeGestureEventHandler, must implement. |
MAX_PRIORITY, MIN_PRIORITY| Constructor and Description |
|---|
SwipeGestureEventHandler(TabSwitcher tabSwitcher,
int dragThreshold,
android.graphics.RectF touchableArea,
long animationDuration)
Creates a new event handler, which allows to handle swipe gestures, which can be used to
switch between tabs.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
isDraggingAllowed()
Returns, whether performing a drag gesture is currently allowed, or not.
|
protected void |
onDown(android.view.MotionEvent event)
The method, which is invoked on implementing subclasses in order to handle, when a drag
gesture has been started.
|
protected void |
onDrag(android.view.MotionEvent event)
The method, which is invoked on implementing subclasses in order to handle, when a drag
gesture is performed.
|
protected void |
onTouchEvent()
The method, which is invoked on implementing subclasses, when a touch event is about to be
handled.
|
protected void |
onUp(android.view.MotionEvent event)
Handles, when a drag gesture has been ended.
|
void |
setCallback(SwipeGestureEventHandler.Callback callback)
Sets the callback, which should be notified about the event handler's events.
|
getTouchableAreacompare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isDragging, isInsideTouchableArea, isReset, reset, setPointerIdpublic SwipeGestureEventHandler(TabSwitcher tabSwitcher, int dragThreshold, android.graphics.RectF touchableArea, long animationDuration)
tabSwitcher - The tab switcher, the event handler belongs to, as an instance of the class TabSwitcher. The tab switcher may not be nulldragThreshold - The drag threshold in pixels as an Integer value. The drag threshold must be
at least 0touchableArea - The bounds of the onscreen area, the handler should take into consideration for
handling touch events, as an instance of the class RectF or null, if the are
should not be restrictedanimationDuration - The duration of the swipe animation in milliseconds as a Long value or -1, if
the default duration should be usedpublic final void setCallback(SwipeGestureEventHandler.Callback callback)
callback - The callback, which should be set, as an instance of the type SwipeGestureEventHandler.Callback or
null, if no callback should be notifiedprotected final boolean isDraggingAllowed()
AbstractTouchEventHandlerisDraggingAllowed in class AbstractTouchEventHandlerprotected final void onTouchEvent()
AbstractTouchEventHandleronTouchEvent in class AbstractTouchEventHandlerprotected final void onDown(android.view.MotionEvent event)
AbstractTouchEventHandleronDown in class AbstractTouchEventHandlerevent - The touch event, which started the drag gesture, as an instance of the class MotionEvent. The touch event may not be nullprotected final void onDrag(android.view.MotionEvent event)
AbstractTouchEventHandleronDrag in class AbstractTouchEventHandlerevent - The last touch event of the drag gesture as an instance of the class MotionEvent. The touch event may not be nullprotected final void onUp(android.view.MotionEvent event)
AbstractTouchEventHandleronUp in class AbstractTouchEventHandlerevent - The touch event, which ended the drag gesture, as an instance of the class MotionEvent or null, if no fling animation should be triggered