... | @@ -54,6 +54,9 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { |
... | @@ -54,6 +54,9 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { |
|
// 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.
|
|
|
|
.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"))
|
|
|
|
|
... | @@ -118,12 +121,32 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { |
... | @@ -118,12 +121,32 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { |
|
.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.
|
|
|
|
.buttonCornerRadius(Util.dp2px(20))
|
|
|
|
|
|
|
|
// Whether the button is a circle shape.
|
|
|
|
.isRound(false)
|
|
bmb.addBuilder(builder);
|
|
bmb.addBuilder(builder);
|
|
}
|
|
}
|
|
```
|
|
```
|
|
After adding builders to BMB, it is ready for a boom.
|
|
After adding builders to BMB, it is ready for a boom.
|
|
|
|
|
|
|
|
### Square Button
|
|
|
|
From version 2.0.8, BMB supports square buttons base on the circle buttons. To make boom-button square, use the following methods for a builder([Example](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/java/com/nightonke/boommenusample/SquareAndPieceCornerRadiusActivity.java)):
|
|
|
|
```
|
|
|
|
return new SimpleCircleButton.Builder()
|
|
|
|
.isRound(false)
|
|
|
|
.shadowCornerRadius(Util.dp2px(20))
|
|
|
|
.buttonCornerRadius(Util.dp2px(20))
|
|
|
|
.normalImageRes(getImageResource());
|
|
|
|
```
|
|
|
|
<img src="https://github.com/Nightonke/BoomMenu/blob/master/Pictures/pieceCornerRadius.png" width=300/>
|
|
|
|
<img src="https://github.com/Nightonke/BoomMenu/blob/master/Pictures/square.png" width=300/>
|
|
|
|
|
|
|
|
And to make the transformation natural, you may want to make the pieces square, too. Check the `setPieceCornerRadius` method and `app:bmb_pieceCornerRadius` attribute [here](https://github.com/Nightonke/BoomMenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB#for-pieces-on-bmb) to achieve that effect.
|
|
|
|
|
|
### Piece Place Enum for Simple Circle Button
|
|
### Piece Place Enum for Simple Circle Button
|
|
All piece-place-enum and button-place-enum can be found in [demo](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/java/com/nightonke/boommenusample/SimpleCircleButtonActivity.java).
|
|
All piece-place-enum and button-place-enum can be found in [demo](https://github.com/Nightonke/BoomMenu/blob/master/app/src/main/java/com/nightonke/boommenusample/SimpleCircleButtonActivity.java).
|
|
|
|
|
... | | ... | |