FlyoutCallback

public abstract class FlyoutCallback extends Object

Callback for determining the behavior of user actions in a flyout that affect the workspace. Use init(BlocklyController, FlyoutCallback) to define this behavior. init(BlocklyController, FlyoutCallback) may be used instead if not using a FlyoutFragment.

Public Constructor Summary

Public Method Summary

abstract BlockGroup
getDraggableBlockGroup(int index, Block blockInList, WorkspacePoint initialBlockPosition)
Handles the selection of the draggable BlockGroup, including possibly adding the block to the Workspace and WorkspaceView.
abstract void
onButtonClicked(View v, String action, BlocklyCategory category)
Called when an action button is clicked (example: when "Create variable" is clicked).

Inherited Method Summary

Public Constructors

public FlyoutCallback ()

Public Methods

public abstract BlockGroup getDraggableBlockGroup (int index, Block blockInList, WorkspacePoint initialBlockPosition)

Handles the selection of the draggable BlockGroup, including possibly adding the block to the Workspace and WorkspaceView.

Parameters
index The list position of the touched block group.
blockInList The root block of the touched block.
initialBlockPosition The initial workspace coordinate for touchedBlockGroup's screen location.
Returns
  • The block group to drag within the workspace.

public abstract void onButtonClicked (View v, String action, BlocklyCategory category)

Called when an action button is clicked (example: when "Create variable" is clicked).

Parameters
v The view that was clicked.
action The callback key associated with the clicked button.
category The category that this action was in.