OnDragToTrashListener

public class OnDragToTrashListener extends Object
implements View.OnDragListener

An View.OnDragListener that is aware of dragged blocks and will trash the blocks if dropped upon.

Field Summary

protected final BlockClipDataHelper mClipHelper
protected final BlocklyController mController

Public Constructor Summary

Public Method Summary

boolean
onDrag(View v, DragEvent event)

Protected Method Summary

boolean
isTrashableBlock(DragEvent event)
Check whether the drag contains a block dragged out of the a WorkspaceView within the current Activity.

Inherited Method Summary

Fields

protected final BlockClipDataHelper mClipHelper

protected final BlocklyController mController

Public Constructors

public OnDragToTrashListener (BlocklyController controller)

Parameters
controller

Public Methods

public boolean onDrag (View v, DragEvent event)

Parameters
v
event

Protected Methods

protected boolean isTrashableBlock (DragEvent event)

Check whether the drag contains a block dragged out of the a WorkspaceView within the current Activity.

Parameters
event The DragEvent to check.
Returns
  • True if it is a trashable block. Otherwise false.