-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Custom Position
Weiping Huang edited this page May 26, 2017
·
2 revisions
Customize the number and positions of pieces and boom-buttons.
Sometimes we may want 12 boom-buttons or more, and perhaps we need to put the 12 pieces and boom-buttons to the positions that are not supported in BMB. Then you can customize number and positions of pieces and boom-buttons.
app:bmb_buttonEnum="textInsideCircle"
app:bmb_piecePlaceEnum="piecePlace_custom"
app:bmb_buttonPlaceEnum="buttonPlace_custom"
Then you need to tell BMB the positions of pieces:
bmb.getCustomPiecePlacePositions().add(new PointF(Util.dp2px(+6), Util.dp2px(-6)));
bmb.getCustomPiecePlacePositions().add(new PointF(0, 0));
bmb.getCustomPiecePlacePositions().add(new PointF(Util.dp2px(-6), Util.dp2px(+6)));
And the positions of boom-buttons:
bmb.getCustomButtonPlacePositions().add(new PointF(Util.dp2px(-80), Util.dp2px(-80)));
bmb.getCustomButtonPlacePositions().add(new PointF(0, 0));
bmb.getCustomButtonPlacePositions().add(new PointF(Util.dp2px(+80), Util.dp2px(+80)));
Notice that the coordinate system is the same as android-platform but the center position is (0, 0). And you don't need to customize both pieces and boom-buttons, check demo for more details.
- Basic Usage
- Simple Circle Button
- Text Inside Circle Button
- Text Outside Circle Button
- Ham Button
- Share Style
- Custom Position
- Button Place Alignments
- Different Ways to Boom
- Ease Animations for Buttons
- Different Order for Buttons
- Other Animations Attributes for Buttons
- Click Event and Listener
- Control BMB
- Use BMB in Action Bar
- Use BMB in Tool Bar
- Use BMB in List
- Use BMB in Fragment
- Attributes for BMB or Pieces on BMB
- Cache Optimization & Boom Area
- Change Boom Buttons Dynamically
- Fade Views
- Version History
- Structure for BMB