Skip to content

Use BMB in List

Weiping Huang edited this page Mar 28, 2017 · 3 revisions

Matters need attention when you need a BMB in list-view or recycler-view.

Use BMB in List

To use BMB in list-view or recycler-view, we need to pay attention to the followings. Check the list-view-demo and recycler-view-demo for details.

  1. Set the BMB's in-list attribute by app:bmb_inList="true" or bmb.setInList(true); to remove background of BMB and get ready for some recycler jobs.
  2. In getView method of list-view or in onBindViewHolder method in recycler-view, remove all the builders of BMB and then add builders to it again:
holder.bmb.clearBuilders();
for (int i = 0; i < holder.bmb.getPiecePlaceEnum().pieceNumber(); i++)
    holder.bmb.addBuilder(BuilderManager.getHamButtonBuilder());