PendingDrag

public class PendingDrag extends Object

PendingDrag collects all the information related to an in-progress drag of a BlockView. It is initialized by Dragger, passed to a Dragger.DragHandler which calls startDrag(View, BlockGroup, ViewPoint) to inform the Dragger how to complete the rest of the drag behavior.

Public Method Summary

BlockGroup
View
ViewPoint
WorkspacePoint
int
Block
BlockView
void
getTouchDownScreen(int[] screenCoordOut)
float
float
WorkspacePoint
BlockView
boolean
boolean
boolean
void
startDrag(View dragInitiator, BlockGroup dragGroup, ViewPoint touchOffset)
This sets the draggable BlockGroup, containing all the dragged blocks.

Inherited Method Summary

Public Methods

public BlockGroup getDragGroup ()

Returns

public View getDragInitiator ()

public ViewPoint getDragTouchOffset ()

Returns
  • The touch offset from the top left corner of the dragged BlockGroup, in view pixels.

public WorkspacePoint getOriginalBlockPosition ()

Returns
  • The initial workspace location of the drag group / root block.

public int getPointerId ()

Returns
  • The pointer id for this drag.

public Block getRootDraggedBlock ()

Returns
  • The root Block of the drag group.

public BlockView getRootDraggedBlockView ()

Returns

public void getTouchDownScreen (int[] screenCoordOut)

Parameters
screenCoordOut
Returns
  • The screen coordinates of the initial ACTION_DOWN event.

public float getTouchDownViewOffsetX ()

Returns
  • The X offset of the initial ACTION_DOWN event, from the left side of the first touched view in local view pixels.

public float getTouchDownViewOffsetY ()

Returns
  • The Y offset of the initial ACTION_DOWN event, from the top of the first touched view in local view pixels.

public WorkspacePoint getTouchDownWorkspaceCoordinates ()

public BlockView getTouchedBlockView ()

Returns

public boolean isAlive ()

Returns
  • True if this PendingDrag has received a continuous stream of events for its pointer.

public boolean isClick ()

public boolean isDragging ()

Returns
  • Whether the drag group has been assigned the this drag should be active.

public void startDrag (View dragInitiator, BlockGroup dragGroup, ViewPoint touchOffset)

This sets the draggable BlockGroup, containing all the dragged blocks. dragGroup must be a root block added to the WorkspaceView, with it's first Block added as a root block in the Workspace.

Parameters
dragInitiator
dragGroup The draggable BlockGroup.
touchOffset The touch offset from the top left corner of dragGroup, in view pixels.