-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Attributes for BMB or Pieces on BMB
Weiping Huang edited this page May 26, 2017
·
7 revisions
How to change the size or margins of dots on BMB?
We always talk about the attributes for boom-buttons of BMB, how about BMB itself?
bmb.setShadowEffect(true);
bmb.setShadowColor(Color.parseColor("#55000000"));
bmb.setShadowOffsetX(20);
bmb.setShadowOffsetY(20);
bmb.setShadowRadius(10);
Or in .xml:
app:bmb_shadowEffect="true"
app:bmb_shadowColor="#55000000"
app:bmb_shadowOffsetX="5dp"
app:bmb_shadowOffsetY="5dp"
app:bmb_shadowRadius="10dp"
bmb.setButtonRadius(Util.dp2px(40));
bmb.setRippleEffect(false);
bmb.setNormalColor(Color.BLACK);
bmb.setHighlightedColor(Color.BLUE);
bmb.setUnableColor(Color.WHITE);
Or in .xml:
app:bmb_buttonRadius="40dp"
app:bmb_rippleEffect="true"
app:bmb_normalColor="@android:color/holo_blue_light"
app:bmb_highlightedColor="@android:color/holo_blue_dark"
app:bmb_unableColor="@android:color/white"
bmb.setDraggable(true);
bmb.setEdgeInsetsInParentView(new Rect(10, 10, 10, 10));
Or in .xml:
app:bmb_draggable="true"
The effect of draggable-BMB looks like below:
For pieces lay on BMB:
bmb.setDotRadius(10);
bmb.setHamWidth(80);
bmb.setHamHeight(20);
bmb.setPieceCornerRadius(4);
bmb.setPieceHorizontalMargin(10);
bmb.setPieceVerticalMargin(10);
bmb.setPieceInclinedMargin(20);
Or in .xml:
app:bmb_dotRadius="5dp"
app:bmb_hamWidth="40dp"
app:bmb_hamHeight="5dp"
app:bmb_pieceCornerRadius="2dp"
app:bmb_pieceHorizontalMargin="5dp"
app:bmb_pieceVerticalMargin="5dp"
app:bmb_pieceInclinedMargin="5dp"
After setting the corner radius of the pieces:
This attribute is useful when you want square buttons but not round:
For more information about square buttons, check:
Square Simple Circle Button
Square Text Inside Circle Button
Square Text Outside Button
bmb.setButtonHorizontalMargin(50);
bmb.setButtonVerticalMargin(40);
bmb.setButtonInclinedMargin(100);
Or in .xml:
app:bmb_buttonHorizontalMargin="20dp"
app:bmb_buttonVerticalMargin="20dp"
app:bmb_buttonInclinedMargin="30dp"
bmb.setDimColor(Color.parseColor("#55000000"))
Or in .xml:
app:bmb_dimColor="#55000000"
- Basic Usage
- Simple Circle Button
- Text Inside Circle Button
- Text Outside Circle Button
- Ham Button
- Share Style
- Custom Position
- Button Place Alignments
- Different Ways to Boom
- Ease Animations for Buttons
- Different Order for Buttons
- Other Animations Attributes for Buttons
- Click Event and Listener
- Control BMB
- Use BMB in Action Bar
- Use BMB in Tool Bar
- Use BMB in List
- Use BMB in Fragment
- Attributes for BMB or Pieces on BMB
- Cache Optimization & Boom Area
- Change Boom Buttons Dynamically
- Fade Views
- Version History
- Structure for BMB