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
  • Simple Circle Button

Simple Circle Button · Changes

Page history
Updated Simple Circle Button (markdown) authored Apr 07, 2017 by Weiping Huang's avatar Weiping Huang
Hide whitespace changes
Inline Side-by-side
Simple-Circle-Button.md
View page @ 1cfcf994
...@@ -38,94 +38,121 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { ...@@ -38,94 +38,121 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) {
Toast.makeText(SimpleCircleButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show(); Toast.makeText(SimpleCircleButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show();
} }
}) })
```
```
// Whether the image-view should rotate. // Whether the image-view should rotate.
.rotateImage(false) .rotateImage(false)
```
```
// Whether the boom-button should have a shadow effect. // Whether the boom-button should have a shadow effect.
.shadowEffect(true) .shadowEffect(true)
```
```
// Set the horizontal shadow-offset of the boom-button. // Set the horizontal shadow-offset of the boom-button.
.shadowOffsetX(20) .shadowOffsetX(20)
```
```
// Set the vertical shadow-offset of the boom-button. // Set the vertical shadow-offset of the boom-button.
.shadowOffsetY(0) .shadowOffsetY(0)
```
```
// Set the radius of shadow of the boom-button. // Set the radius of shadow of the boom-button.
.shadowRadius(Util.dp2px(20)) .shadowRadius(Util.dp2px(20))
```
```
// Set the corner-radius of the shadow. // Set the corner-radius of the shadow.
.shadowCornerRadius(Util.dp2px(20)) .shadowCornerRadius(Util.dp2px(20))
```
```
// Set the color of the shadow of boom-button. // Set the color of the shadow of boom-button.
.shadowColor(Color.parseColor("#ee000000")) .shadowColor(Color.parseColor("#ee000000"))
```
```
// Set the image resource when boom-button is at normal-state. // Set the image resource when boom-button is at normal-state.
.normalImageRes(R.drawable.jellyfish) .normalImageRes(R.drawable.jellyfish)
```
```
// Set the image drawable when boom-button is at normal-state. // Set the image drawable when boom-button is at normal-state.
.normalImageDrawable(getResources().getDrawable(R.drawable.jellyfish, null)) .normalImageDrawable(getResources().getDrawable(R.drawable.jellyfish, null))
```
```
// Set the image resource when boom-button is at highlighted-state. // Set the image resource when boom-button is at highlighted-state.
.highlightedImageRes(R.drawable.bat) .highlightedImageRes(R.drawable.bat)
```
```
// Set the image drawable when boom-button is at highlighted-state. // Set the image drawable when boom-button is at highlighted-state.
.highlightedImageDrawable(getResources().getDrawable(R.drawable.bat, null)) .highlightedImageDrawable(getResources().getDrawable(R.drawable.bat, null))
// Set the image resource when boom-button is at unable-state. // Set the image resource when boom-button is at unable-state.
.unableImageRes(R.drawable.butterfly) .unableImageRes(R.drawable.butterfly)
```
```
// Set the image drawable when boom-button is at unable-state. // Set the image drawable when boom-button is at unable-state.
.unableImageDrawable(getResources().getDrawable(R.drawable.butterfly, null)) .unableImageDrawable(getResources().getDrawable(R.drawable.butterfly, null))
```
```
// Set the rect of image. // Set the rect of image.
// By this method, you can set the position and size of the image-view in boom-button. // By this method, you can set the position and size of the image-view in boom-button.
// For example, builder.imageRect(new Rect(0, 50, 100, 100)) will make the // For example, builder.imageRect(new Rect(0, 50, 100, 100)) will make the
// image-view's size to be 100 * 50 and margin-top to be 50 pixel. // image-view's size to be 100 * 50 and margin-top to be 50 pixel.
.imageRect(new Rect(Util.dp2px(10), Util.dp2px(10), Util.dp2px(70), Util.dp2px(70))) .imageRect(new Rect(Util.dp2px(10), Util.dp2px(10), Util.dp2px(70), Util.dp2px(70)))
```
```
// Set the padding of image. // Set the padding of image.
// By this method, you can control the padding in the image-view. // By this method, you can control the padding in the image-view.
// For instance, builder.imagePadding(new Rect(10, 10, 10, 10)) will make the // For instance, builder.imagePadding(new Rect(10, 10, 10, 10)) will make the
// image-view content 10-pixel padding to itself. // image-view content 10-pixel padding to itself.
.imagePadding(new Rect(0, 0, 0, 0)) .imagePadding(new Rect(0, 0, 0, 0))
```
```
// Whether the boom-button should have a ripple effect. // Whether the boom-button should have a ripple effect.
.rippleEffect(true) .rippleEffect(true)
```
```
// The color of boom-button when it is at normal-state. // The color of boom-button when it is at normal-state.
.normalColor(Color.RED) .normalColor(Color.RED)
```
```
// The resource of color of boom-button when it is at normal-state. // The resource of color of boom-button when it is at normal-state.
.normalColorRes(R.color.red) .normalColorRes(R.color.red)
```
```
// The color of boom-button when it is at highlighted-state. // The color of boom-button when it is at highlighted-state.
.highlightedColor(Color.BLUE) .highlightedColor(Color.BLUE)
```
```
// The resource of color of boom-button when it is at highlighted-state. // The resource of color of boom-button when it is at highlighted-state.
.highlightedColorRes(R.color.blue) .highlightedColorRes(R.color.blue)
```
```
// The color of boom-button when it is at unable-state. // The color of boom-button when it is at unable-state.
.unableColor(Color.BLACK) .unableColor(Color.BLACK)
```
```
// The resource of color of boom-button when it is at unable-state. // The resource of color of boom-button when it is at unable-state.
.unableColorRes(R.color.black) .unableColorRes(R.color.black)
```
```
// The color of boom-button when it is just a piece. // The color of boom-button when it is just a piece.
.pieceColor(Color.WHITE) .pieceColor(Color.WHITE)
```
```
// The resource of color of boom-button when it is just a piece. // The resource of color of boom-button when it is just a piece.
.pieceColorRes(R.color.white) .pieceColorRes(R.color.white)
```
```
// Whether the boom-button is unable, default value is false. // Whether the boom-button is unable, default value is false.
.unable(false) .unable(false)
```
```
// The radius of boom-button, in pixel. // The radius of boom-button, in pixel.
.buttonRadius(Util.dp2px(40)) .buttonRadius(Util.dp2px(40))
```
```
// Set the corner-radius of button. // Set the corner-radius of button.
.buttonCornerRadius(Util.dp2px(20)) .buttonCornerRadius(Util.dp2px(20))
```
```
// Whether the button is a circle shape. // Whether the button is a circle shape.
.isRound(false); .isRound(false);
bmb.addBuilder(builder); bmb.addBuilder(builder);
......
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. Button Place Alignments
  8. Different Ways to Boom
  9. Ease Animations for Buttons
  10. Different Order for Buttons
  11. Other Animations Attributes for Buttons
  12. Click Event and Listener
  13. Control BMB
  14. Use BMB in Action Bar
  15. Use BMB in Tool Bar
  16. Use BMB in List
  17. Use BMB in Fragment
  18. Attributes for BMB or Pieces on BMB
  19. Cache Optimization & Boom Area
  20. Version History
  21. Structure for BMB
  22. Change Boom Buttons Dynamically