|
|
Matters need attention when you need a BMB in list-view or recycler-view.
|
|
|
|
|
|
<img src="https://github.com/Nightonke/BoomMenu/blob/master/Pictures/list-example.gif">
|
|
|
|
|
|
###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](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/java/com/nightonke/boommenusample/ListViewActivity.java) and [recycler-view-demo](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/java/com/nightonke/boommenusample/RecyclerViewActivity.java) 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());
|
|
|
``` |
|
|
\ No newline at end of file |