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 |
isAlive()
|
boolean |
isClick()
|
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 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 void getTouchDownScreen (int[] screenCoordOut)
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 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.
|