Dragger

public class Dragger extends Object

Controller for dragging blocks and groups of blocks within a workspace.

Nested Class Summary

interface Dragger.DragHandler Interface for processing a drag behavior. 
@interface Dragger.DragMode  
@interface Dragger.FinishDragBehavior  

Public Constructor Summary

Dragger(BlocklyController blocklyController)

Public Method Summary

BlockTouchHandler
buildImmediateDragBlockTouchHandler(Dragger.DragHandler dragHandler)
Creates a BlockTouchHandler that will initiate a drag as soon as the BlockView receives a MotionEvent directly (not via interception).
BlockTouchHandler
buildSloppyBlockTouchHandler(Dragger.DragHandler dragHandler)
Creates a BlockTouchHandler that will initiate a drag only after the user has dragged beyond some touch threshold.
View.OnDragListener
void
removeFromDraggingConnections(Block rootBlock)
Remove all the connections in a blocks tree from the list of connections being dragged.
void
setTouchSlop(float slop)
void

Inherited Method Summary

Public Constructors

public Dragger (BlocklyController blocklyController)

Parameters
blocklyController The BlocklyController managing Blocks in this activity.

Public Methods

public BlockTouchHandler buildImmediateDragBlockTouchHandler (Dragger.DragHandler dragHandler)

Creates a BlockTouchHandler that will initiate a drag as soon as the BlockView receives a MotionEvent directly (not via interception).

Parameters
dragHandler The Dragger.DragHandler to handle gestures for the constructed BlockTouchHandler.
Returns

public BlockTouchHandler buildSloppyBlockTouchHandler (Dragger.DragHandler dragHandler)

Creates a BlockTouchHandler that will initiate a drag only after the user has dragged beyond some touch threshold.

Parameters
dragHandler The Dragger.DragHandler to handle gestures for the constructed BlockTouchHandler.
Returns

public View.OnDragListener getDragEventListener ()

Returns

public void removeFromDraggingConnections (Block rootBlock)

Remove all the connections in a blocks tree from the list of connections being dragged. This is used when removing shadow blocks from a block tree during a drag. If there's no drag in progress this has no effects.

Parameters
rootBlock The start of the block tree to remove connections for.

public void setTouchSlop (float slop)

Parameters
slop The required touch slop before starting a drag.

public void setWorkspaceView (WorkspaceView view)

Parameters
view