CategoryTabs.LabelAdapter

public static abstract class CategoryTabs.LabelAdapter extends Object
Known Direct Subclasses

Public Constructor Summary

Public Method Summary

abstract void
onBindLabel(View labelView, BlocklyCategory category, int position)
Bind a BlocklyCategory to a label view, with any appropriate styling.
abstract View
onCreateLabel()
Create a label view for a tab.
void
onSelectionChanged(View labelView, BlocklyCategory category, int position, boolean isSelected)
Called when a label is bound or when clicking results in a selection change.

Inherited Method Summary

Public Constructors

public CategoryTabs.LabelAdapter ()

Public Methods

public abstract void onBindLabel (View labelView, BlocklyCategory category, int position)

Bind a BlocklyCategory to a label view, with any appropriate styling.

Parameters
labelView The tab's label view.
category The category to bind to.
position The position of the category in the list of tabs.

public abstract View onCreateLabel ()

Create a label view for a tab. This view will later be assigned an View.OnClickListener to handle tab selection and deselection.

public void onSelectionChanged (View labelView, BlocklyCategory category, int position, boolean isSelected)

Called when a label is bound or when clicking results in a selection change. Responsible for updating the view to reflect the new state, including applying the category name.

By default, it calls setSelected(boolean). Many views and/or styles will handle this appropriately.

Parameters
labelView The tab's label view.
category The category to bind to.
position The position of the category in the list of tabs.
isSelected the new selection state.