CategorySelectorFragment

public class CategorySelectorFragment extends Fragment
implements CategorySelectorUI

Creates a set of tabs of Blockly categories. The set of categories should be provided by setContents(BlocklyCategory). Interaction with other fragments is not handled by this class and should be done by registering a callback with setCategoryCallback(CategorySelectorUI.Callback).

Field Summary

protected CategoryView mCategoryView
protected BlocklyController mController
protected WorkspaceHelper mHelper
protected int mLabelRotation
protected int mScrollOrientation

Public Constructor Summary

Public Method Summary

BlocklyCategory
View
onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
void
onInflate(Context context, AttributeSet attrs, Bundle savedInstanceState)
void
void
setContents(BlocklyCategory rootCategory)
Set the root category for the category selector.
void
setCurrentCategory(BlocklyCategory category)
Sets the currently selected category.

Inherited Method Summary

Fields

protected CategoryView mCategoryView

protected BlocklyController mController

protected WorkspaceHelper mHelper

protected int mLabelRotation

protected int mScrollOrientation

Public Constructors

public CategorySelectorFragment ()

Public Methods

public BlocklyCategory getCurrentCategory ()

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 setCategoryCallback (CategorySelectorUI.Callback categoryCallback)

Parameters
categoryCallback

public void setContents (BlocklyCategory rootCategory)

Set the root category for the category selector.

Parameters
rootCategory The top-level category in the toolbox.

public void setCurrentCategory (BlocklyCategory category)

Sets the currently selected category. If category is null, or if the category is not a member of the contents previously set, the current category should be unselected.

Parameters
category the category to use as currently selected.