public class PullDownGestureEventHandler extends AbstractDragGestureEventHandler
Modifier and Type | Class and Description |
---|---|
static interface |
PullDownGestureEventHandler.Callback
Defines the interface, a class, which should be notified about the events of a
PullDownGestureEventHandler , must implement. |
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
PullDownGestureEventHandler(TabSwitcher tabSwitcher,
int dragThreshold,
android.graphics.RectF touchableArea)
Creates a new event handler, which allows to handle pull down gestures, which can be used to
show the tab switcher by pulling down the currently selected tab, when using the smartphone
layout.
|
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(PullDownGestureEventHandler.Callback callback)
Sets the callback, which should be notified about the event handler's events.
|
getTouchableArea
compare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isDragging, isInsideTouchableArea, isReset, reset, setPointerId
public PullDownGestureEventHandler(@NonNull TabSwitcher tabSwitcher, int dragThreshold, @Nullable android.graphics.RectF touchableArea)
tabSwitcher
- The tab switcher, the event handler belongs to, as an instance of the class TabSwitcher
. The tab switcher may not be nulldragThreshold
- The threshold of the drag helper, which is used to recognize drag gestures, in pixels
as an Integer
value The 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 arepublic final void setCallback(@Nullable PullDownGestureEventHandler.Callback callback)
callback
- The callback, which should be set, as an instance of the type PullDownGestureEventHandler.Callback
or
null, if no callback should be notifiedprotected final boolean isDraggingAllowed()
AbstractTouchEventHandler
isDraggingAllowed
in class AbstractTouchEventHandler
protected final void onTouchEvent()
AbstractTouchEventHandler
onTouchEvent
in class AbstractTouchEventHandler
protected final void onDown(@NonNull android.view.MotionEvent event)
AbstractTouchEventHandler
onDown
in class AbstractTouchEventHandler
event
- 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(@NonNull android.view.MotionEvent event)
AbstractTouchEventHandler
onDrag
in class AbstractTouchEventHandler
event
- 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(@Nullable android.view.MotionEvent event)
AbstractTouchEventHandler
onUp
in class AbstractTouchEventHandler
event
- The touch event, which ended the drag gesture, as an instance of the class MotionEvent
or null, if no fling animation should be triggered