WorkspaceView

public class WorkspaceView extends NonPropagatingViewGroup

Handles updating the viewport into the workspace and is the parent view for all blocks. This view is responsible for handling drags. A drag on the workspace will move the viewport and a drag on a block or stack of blocks will drag those within the workspace.

Constant Summary

String BLOCK_GROUP_CLIP_DATA_LABEL

Inherited Constant Summary

Inherited Field Summary

Public Constructor Summary

WorkspaceView(Context context)
WorkspaceView(Context context, AttributeSet attrs)
WorkspaceView(Context context, AttributeSet attrs, int defStyleAttr)

Public Method Summary

Rect
getBlocksBoundingBox(Rect outRect)
WorkspaceHelper
void
onMeasure(int widthMeasureSpec, int heightMeasureSpec)
void
setController(BlocklyController controller)
Sets the workspace this view should display.
void
setDragger(Dragger dragger)
Updates the Dragger for this workspace view and passes through the view for the trash can.

Protected Method Summary

void
onLayout(boolean changed, int l, int t, int r, int b)

Inherited Method Summary

Constants

public static final String BLOCK_GROUP_CLIP_DATA_LABEL

Constant Value: "BlockGroupClipData"

Public Constructors

public WorkspaceView (Context context)

Parameters
context

public WorkspaceView (Context context, AttributeSet attrs)

Parameters
context
attrs

public WorkspaceView (Context context, AttributeSet attrs, int defStyleAttr)

Parameters
context
attrs
defStyleAttr

Public Methods

public Rect getBlocksBoundingBox (Rect outRect)

Parameters
outRect
Returns
  • The bounding box in view coordinates of the workspace region occupied by blocks.

public WorkspaceHelper getWorkspaceHelper ()

public void onMeasure (int widthMeasureSpec, int heightMeasureSpec)

Parameters
widthMeasureSpec
heightMeasureSpec

public void setController (BlocklyController controller)

Sets the workspace this view should display.

Parameters
controller The controller for this instance.

public void setDragger (Dragger dragger)

Updates the Dragger for this workspace view and passes through the view for the trash can.

Parameters
dragger The Dragger to use in this workspace.

Protected Methods

protected void onLayout (boolean changed, int l, int t, int r, int b)

Parameters
changed
l
t
r
b