... | ... | @@ -39,155 +39,214 @@ for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { |
|
|
Toast.makeText(TextOutsideCircleButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show();
|
|
|
}
|
|
|
})
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Whether the image-view should rotate.
|
|
|
.rotateImage(false)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Whether the text-view should rotate.
|
|
|
.rotateText(false)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Whether the boom-button should have a shadow effect.
|
|
|
.shadowEffect(true)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the horizontal shadow-offset of the boom-button.
|
|
|
.shadowOffsetX(20)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the vertical shadow-offset of the boom-button.
|
|
|
.shadowOffsetY(0)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the radius of shadow of the boom-button.
|
|
|
.shadowRadius(Util.dp2px(20))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the corner-radius of the shadow.
|
|
|
.shadowCornerRadius(Util.dp2px(20))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the color of the shadow of boom-button.
|
|
|
.shadowColor(Color.parseColor("#ee000000"))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the image resource when boom-button is at normal-state.
|
|
|
.normalImageRes(R.drawable.jellyfish)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the image drawable when boom-button is at normal-state.
|
|
|
.normalImageDrawable(getResources().getDrawable(R.drawable.jellyfish, null))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the image resource when boom-button is at highlighted-state.
|
|
|
.highlightedImageRes(R.drawable.bat)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the image drawable when boom-button is at highlighted-state.
|
|
|
.highlightedImageDrawable(getResources().getDrawable(R.drawable.bat, null))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the image resource when boom-button is at unable-state.
|
|
|
.unableImageRes(R.drawable.butterfly)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the image drawable when boom-button is at unable-state.
|
|
|
.unableImageDrawable(getResources().getDrawable(R.drawable.butterfly, null))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the rect of image.
|
|
|
// 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
|
|
|
// 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)))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the padding of image.
|
|
|
// 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
|
|
|
// image-view content 10-pixel padding to itself.
|
|
|
.imagePadding(new Rect(0, 0, 0, 0))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text resource when boom-button is at normal-state.
|
|
|
.normalTextRes(R.string.text_outside_circle_button_text_normal)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text resource when boom-button is at highlighted-state.
|
|
|
.highlightedTextRes(R.string.text_outside_circle_button_text_highlighted)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text resource when boom-button is at unable-state.
|
|
|
.unableTextRes(R.string.text_outside_circle_button_text_unable)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text when boom-button is at normal-state.
|
|
|
.normalText("Put your normal text here")
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text when boom-button is at highlighted-state.
|
|
|
.highlightedText("Put your highlighted text here")
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text when boom-button is at unable-state.
|
|
|
.unableText("Unable!")
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the color of text when boom-button is at normal-state.
|
|
|
.normalTextColor(Color.BLACK)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the resource of color of text when boom-button is at normal-state.
|
|
|
.normalTextColorRes(R.color.black)
|
|
|
```
|
|
|
```
|
|
|
// Set the color of text when boom-button is at highlighted-state.
|
|
|
.highlightedTextColor(Color.BLUE)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the resource of color of text when boom-button is at highlighted-state.
|
|
|
.highlightedTextColorRes(R.color.blue)
|
|
|
```
|
|
|
```
|
|
|
// Set the color of text when boom-button is at unable-state.
|
|
|
.unableTextColor(Color.RED)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the resource of color of text when boom-button is at unable-state.
|
|
|
.unableTextColorRes(R.color.red)
|
|
|
```
|
|
|
```
|
|
|
// Set the top-margin between text-view and the circle button.
|
|
|
// Don't need to mind the shadow, BMB will mind this in code.
|
|
|
.textTopMargin(20)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The width of text-view.
|
|
|
.textWidth(200)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The height of text-view
|
|
|
.textHeight(50)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the padding of text.
|
|
|
// By this method, you can control the padding in the text-view.
|
|
|
// For instance, builder.textPadding(new Rect(10, 10, 10, 10)) will make the
|
|
|
// text-view content 10-pixel padding to itself.
|
|
|
.textPadding(new Rect(0, 0, 0, 0))
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the typeface of the text.
|
|
|
.typeface(Typeface.DEFAULT_BOLD)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the maximum of the lines of text-view.
|
|
|
.maxLines(2)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the gravity of text-view.
|
|
|
.textGravity(Gravity.CENTER)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the ellipsize of the text-view.
|
|
|
.ellipsize(TextUtils.TruncateAt.MIDDLE)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Set the text size of the text-view.
|
|
|
.textSize(10)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Whether the boom-button should have a ripple effect.
|
|
|
.rippleEffect(true)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The color of boom-button when it is at normal-state.
|
|
|
.normalColor(Color.RED)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The resource of color of boom-button when it is at normal-state.
|
|
|
.normalColorRes(R.color.red)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The color of boom-button when it is at highlighted-state.
|
|
|
.highlightedColor(Color.BLUE)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The resource of color of boom-button when it is at highlighted-state.
|
|
|
.highlightedColorRes(R.color.blue)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The color of boom-button when it is at unable-state.
|
|
|
.unableColor(Color.BLACK)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The resource of color of boom-button when it is at unable-state.
|
|
|
.unableColorRes(R.color.black)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The color of boom-button when it is just a piece.
|
|
|
.pieceColor(Color.WHITE)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The resource of color of boom-button when it is just a piece.
|
|
|
.pieceColorRes(R.color.white)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// Whether the boom-button is unable, default value is false.
|
|
|
.unable(true)
|
|
|
|
|
|
```
|
|
|
```
|
|
|
// The radius of boom-button, in pixel.
|
|
|
.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);
|
... | ... | |