... | @@ -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);
|
... | | ... | |