public class TabletDragTabsEventHandler extends AbstractDragTabsEventHandler<AbstractDragTabsEventHandler.Callback>
AbstractDragTabsEventHandler.Callback, AbstractDragTabsEventHandler.DragState
MAX_PRIORITY, MIN_PRIORITY
Constructor and Description |
---|
TabletDragTabsEventHandler(TabSwitcher tabSwitcher,
Arithmetics arithmetics,
de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)
Creates a new drag handler, which allows to calculate the position and state of tabs on touch
events, when using the tablet layout.
|
Modifier and Type | Method and Description |
---|---|
protected AbstractItem |
getFocusedItem(float position)
The method, which is invoked on implementing subclasses in order to retrieve the item, which
corresponds to the view, which is focused when clicking/dragging at a specific position.
|
android.graphics.RectF |
getTouchableArea()
Returns the bounds of the onscreen area, the handler takes into consideration for handling
touch events.
|
getArithmetics, getCallback, handleDrag, isDragging, isDraggingAllowed, isSwipeThresholdReached, onDown, onDrag, onOvershootEnd, onOvershootReverted, onOvershootStart, onReset, onTouchEvent, onUp, reset, setCallback, setDragState
compare, equals, getDragHelper, getPriority, getTabSwitcher, getVelocityTracker, handleTouchEvent, hashCode, isInsideTouchableArea, isReset, setPointerId
public TabletDragTabsEventHandler(@NonNull TabSwitcher tabSwitcher, @NonNull Arithmetics arithmetics, @NonNull de.mrapp.android.util.view.AttachedViewRecycler<AbstractItem,?> viewRecycler)
tabSwitcher
- The tab switcher, whose tabs' positions and states should be calculated by the drag
handler, as an instance of the class TabSwitcher
. The tab switcher may not be
nullarithmetics
- The arithmetics, which should be used to calculate the position, size and rotation of
tabs, as an instance of the type Arithmetics
. The arithmetics may not be
nullviewRecycler
- The view recycler, which allows to inflate the views, which are used to visualize the
tabs, whose positions and states should be calculated by the tab switcher, as an
instance of the class AttachedViewRecycler. The view recycler may not be null@NonNull public final android.graphics.RectF getTouchableArea()
AbstractTouchEventHandler
getTouchableArea
in class AbstractTouchEventHandler
RectF
or null, if the area is not
restricted@Nullable protected final AbstractItem getFocusedItem(float position)
AbstractDragTabsEventHandler
getFocusedItem
in class AbstractDragTabsEventHandler<AbstractDragTabsEventHandler.Callback>
position
- The position on the dragging axis in pixels as a Float
valueAbstractItem
or null, if no view is focused