CategoryView

public class CategoryView extends RelativeLayout

View wrapper for toolbox components.

Constant Summary

float BLOCKS_BACKGROUND_LIGHTNESS
int DEFAULT_CATEGORIES_BACKGROUND_ALPHA
int DEFAULT_CATEGORIES_BACKGROUND_COLOR

Inherited Constant Summary

Field Summary

protected CategoryTabs mCategoryTabs
protected BlocklyCategory mCurrentCategory
protected BlocklyCategory mRootCategory

Inherited Field Summary

Public Constructor Summary

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

Public Method Summary

BlocklyCategory
boolean
void
reset()
void
void
setContents(BlocklyCategory topLevelCategory)
Set the root category for the toolbox.
void
void
setLabelRotation(int rotation)
void
setScrollOrientation(int orientation)

Protected Method Summary

int
getBackgroundColor(int categoryColor)
void
void

Inherited Method Summary

Constants

protected static final float BLOCKS_BACKGROUND_LIGHTNESS

Constant Value: 0.75

public static final int DEFAULT_CATEGORIES_BACKGROUND_ALPHA

Constant Value: 255

public static final int DEFAULT_CATEGORIES_BACKGROUND_COLOR

Constant Value: -3355444

Fields

protected CategoryTabs mCategoryTabs

protected BlocklyCategory mCurrentCategory

protected BlocklyCategory mRootCategory

Public Constructors

public CategoryView (Context context)

Parameters
context

public CategoryView (Context context, AttributeSet attrs)

Parameters
context
attrs

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

Parameters
context
attrs
defStyleAttr

Public Methods

public BlocklyCategory getCurrentCategory ()

public boolean isCloseable ()

public void reset ()

public void setCallback (CategorySelectorUI.Callback callback)

Parameters
callback

public void setContents (BlocklyCategory topLevelCategory)

Set the root category for the toolbox. This top level category must contain a list of subcategories or be null. If it has subcategories, it will render each subcategory with its own tab.

Parameters
topLevelCategory The top-level category in the toolbox.

public void setCurrentCategory (BlocklyCategory category)

Parameters
category

public void setLabelRotation (int rotation)

Parameters
rotation

public void setScrollOrientation (int orientation)

Parameters
orientation

Protected Methods

protected int getBackgroundColor (int categoryColor)

Parameters
categoryColor

protected void onFinishInflate ()

protected void updateCategoryColors (BlocklyCategory curCategory)

Parameters
curCategory