WorkspaceFragment

public class WorkspaceFragment extends Fragment

The WorkspaceFragement holds the active WorkspaceView and workspace BlockViews.

The workspace can be configured as scrollable or fixed via the scrollable attribute. For example:

 <fragment
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:blockly="http://schemas.android.com/apk/res-auto"
     android:name="com.google.blockly.WorkspaceFragment"
     android:id="@+id/blockly_workspace"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     />
 

Public Constructor Summary

Public Method Summary

Workspace
WorkspaceView
View
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void
onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState)
void
setController(BlocklyController controller)
Sets the controller to use in this fragment for instantiating views.

Inherited Method Summary

Public Constructors

public WorkspaceFragment ()

Public Methods

public Workspace getWorkspace ()

Returns
  • The workspace being used by this fragment.

public WorkspaceView getWorkspaceView ()

Returns

public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)

Parameters
inflater
container
savedInstanceState

public void onInflate (Context context, AttributeSet attrs, Bundle savedInstanceState)

Parameters
context
attrs
savedInstanceState

public void setController (BlocklyController controller)

Sets the controller to use in this fragment for instantiating views. This should be the same controller used for any associated FlyoutFragments.

Parameters
controller The controller backing this fragment.