Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B BoomMenu
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 114
    • Issues 114
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 5
    • Merge requests 5
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • 黄伟平
  • BoomMenu
  • Wiki
  • Custom Position

Custom Position · Changes

Page history
Updated Custom Position (markdown) authored May 27, 2017 by Weiping Huang's avatar Weiping Huang
Hide whitespace changes
Inline Side-by-side
Custom-Position.md
View page @ 7701025e
// Todo
\ No newline at end of file
<img src="https://github.com/Nightonke/BoomMenuButton-Images/blob/master/Android/CustomPosition.gif" width=300>
Customize the number and positions of pieces and boom-buttons.
### Custom Position
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](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/java/com/nightonke/boommenusample/CustomPositionActivity.java) for more details.
\ No newline at end of file
Clone repository
Chapters
  1. Basic Usage
  2. Simple Circle Button
  3. Text Inside Circle Button
  4. Text Outside Circle Button
  5. Ham Button
  6. Share Style
  7. Custom Position
  8. Button Place Alignments
  9. Different Ways to Boom
  10. Ease Animations for Buttons
  11. Different Order for Buttons
  12. Other Animations Attributes for Buttons
  13. Click Event and Listener
  14. Control BMB
  15. Use BMB in Action Bar
  16. Use BMB in Tool Bar
  17. Use BMB in List
  18. Use BMB in Fragment
  19. Attributes for BMB or Pieces on BMB
  20. Cache Optimization & Boom Area
  21. Change Boom Buttons Dynamically
  22. Fade Views
  23. Version History
  24. Structure for BMB