BlockRecyclerViewHelper

public class BlockRecyclerViewHelper extends Object

Provides the standard configuration for a ERROR(/android.support.v7.widget.RecyclerView) to display a list of blocks, labels, and buttons.

Nested Class Summary

class BlockRecyclerViewHelper.Adapter Adapts Blocks in list into BlockGroups inside {@Link FrameLayout}. 
class BlockRecyclerViewHelper.CategoryCallback Internal implementation that listens to changes to the category and refreshes the recycler view if it changes. 

Public Constructor Summary

BlockRecyclerViewHelper(RecyclerView recyclerView, Context context)

Public Method Summary

BlocklyCategory
void
init(BlocklyController controller, FlyoutCallback callback)
Initialize this helper.
void
reset()
Reset all the initialized components so this object may be attached to a new controller or callback.
void
setCurrentCategory(BlocklyCategory category)
Sets the category to connect to the RecyclerView.
void
setScrollOrientation(int scrollOrientation)
Change the direction blocks should be laid out and scrolled in the RecyclerView.

Inherited Method Summary

Public Constructors

public BlockRecyclerViewHelper (RecyclerView recyclerView, Context context)

Parameters
recyclerView
context

Public Methods

public BlocklyCategory getCurrentCategory ()

Returns
  • The currently set category.

public void init (BlocklyController controller, FlyoutCallback callback)

Initialize this helper. The controller and callback allows user interactions to be handled correctly.

Parameters
controller The controller to use for view creation and drag handling.
callback The FlyoutCallback that defines how the block list will respond to user events.

public void reset ()

Reset all the initialized components so this object may be attached to a new controller or callback. The context and recycler view this was created with will be retained.

public void setCurrentCategory (BlocklyCategory category)

Sets the category to connect to the RecyclerView.

Parameters
category The category to display blocks for.

public void setScrollOrientation (int scrollOrientation)

Change the direction blocks should be laid out and scrolled in the RecyclerView.