### Create Square Button Configuration Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure a button to be square by setting `isRound(false)` and specifying corner radii. This example also sets a normal image resource. ```java return new SimpleCircleButton.Builder() .isRound(false) .shadowCornerRadius(Util.dp2px(20)) .buttonCornerRadius(Util.dp2px(20)) .normalImageRes(getImageResource()); ``` -------------------------------- ### Basic Ham Button Builder Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Creates a Ham Button with basic text and image resources. This is a starting point for customizing individual buttons within the menu. ```java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { HamButton.Builder builder = new HamButton.Builder() .normalImageRes(R.drawable.butterfly) .normalTextRes("Butter Doesn't fly!") .subNormalTextRes("Little butter Doesn't fly, either!"); bmb.addBuilder(builder); } ``` -------------------------------- ### BoomEnum.LINE Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the LINE boom animation enum. ```java bmb.setBoomEnum(BoomEnum.LINE); ``` -------------------------------- ### BoomEnum.PARABOLA_2 Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the PARABOLA_2 boom animation enum. ```java bmb.setBoomEnum(BoomEnum.PARABOLA_2); ``` -------------------------------- ### BoomEnum.PARABOLA_3 Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the PARABOLA_3 boom animation enum. ```java bmb.setBoomEnum(BoomEnum.PARABOLA_3); ``` -------------------------------- ### BoomEnum.PARABOLA_4 Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the PARABOLA_4 boom animation enum. ```java bmb.setBoomEnum(BoomEnum.PARABOLA_4); ``` -------------------------------- ### BoomEnum.PARABOLA_1 Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the PARABOLA_1 boom animation enum. ```java bmb.setBoomEnum(BoomEnum.PARABOLA_1); ``` -------------------------------- ### BoomEnum.HORIZONTAL_THROW_2 Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the HORIZONTAL_THROW_2 boom animation enum. ```java bmb.setBoomEnum(BoomEnum.HORIZONTAL_THROW_2); ``` -------------------------------- ### BoomEnum.RANDOM Animation Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Example of setting the RANDOM boom animation enum. This enum randomly selects other boom animations. ```java bmb.setBoomEnum(BoomEnum.RANDOM); ``` -------------------------------- ### Set Show Move Ease Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the move animation ease for when a button booms using XML attributes. The default is outBack. ```XML app:bmb_showMoveEaseEnum="outBack" ``` -------------------------------- ### Set Show Scale Ease Animation Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the scale animation ease for when a button booms. The default is EaseOutBack. ```Java bmb.setShowScaleEaseEnum(EaseEnum.EaseOutBack); ``` -------------------------------- ### Set Show Move Ease Animation Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the move animation ease for when a button booms. The default is EaseOutBack. ```Java bmb.setShowMoveEaseEnum(EaseEnum.EaseOutBack); ``` -------------------------------- ### Set Show Scale Ease Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the scale animation ease for when a button booms using XML attributes. The default is outBack. ```XML app:bmb_showScaleEaseEnum="outBack" ``` -------------------------------- ### Initialize BoomMenuButton in Java Source: https://github.com/nightonke/boommenu/wiki/Basic-Usage Find the BoomMenuButton instance in your Java code using its ID. This is the first step to programmatically configure the button. ```java BoomMenuButton bmb = (BoomMenuButton) findViewById(R.id.bmb); ``` -------------------------------- ### Configure Custom Piece and Button Positions Source: https://github.com/nightonke/boommenu/wiki/Custom-Position Set these XML attributes to enable custom placement for pieces and buttons. Ensure `piecePlaceEnum` and `buttonPlaceEnum` are set to `piecePlace_custom` and `buttonPlace_custom` respectively. ```xml app:bmb_buttonEnum="textInsideCircle" app:bmb_piecePlaceEnum="piecePlace_custom" app:bmb_buttonPlaceEnum="buttonPlace_custom" ``` -------------------------------- ### Set Other Animation Attributes in XML Source: https://github.com/nightonke/boommenu/wiki/Other-Animations-Attributes-for-Buttons Configure animation delays, durations, rotation, and frame rate using XML attributes. Set showDelay to 0 for immediate display and showDuration to 1000ms for a 1-second show animation. Adjust frames for animation smoothness. ```xml app:bmb_showDelay="0" app:bmb_showDuration="1000" app:bmb_rotateDegree="1080" app:bmb_hideDelay="0" app:bmb_hideDuration="500" app:bmb_frames="60" ``` -------------------------------- ### Enable Instant Auto-Boom on Show Source: https://github.com/nightonke/boommenu/wiki/Control-BMB Configure BMB to automatically boom instantly when it is shown. This can be set programmatically or in XML. ```java bmb.setAutoBoomImmediately(true); ``` ```xml app:bmb_autoBoomImmediately="true" ``` -------------------------------- ### Set Show Rotate Ease Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the rotate animation ease for when a button booms using XML attributes. The default is outBack. ```XML app:bmb_showRotateEaseEnum="outBack" ``` -------------------------------- ### Configure Square Button Builder Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Use this builder configuration to create square buttons instead of round ones. Ensure `isRound(false)` is set. ```java return new TextOutsideCircleButton.Builder() .isRound(false) .shadowCornerRadius(Util.dp2px(15)) .buttonCornerRadius(Util.dp2px(15)) .normalImageRes(getImageResource()) .normalTextRes(R.string.text_outside_circle_button_text_normal); ``` -------------------------------- ### Set Show Rotate Ease Animation Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the rotate animation ease for when a button booms. The default is EaseOutBack. ```Java bmb.setShowRotateEaseEnum(EaseEnum.EaseOutBack); ``` -------------------------------- ### Set Hide Move Ease Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the move animation ease for when a button re-booms using XML attributes. The default is inBack. ```XML app:bmb_hideMoveEaseEnum="inBack" ``` -------------------------------- ### Add Simple Circle Button Builders Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Iterates to add simple circle buttons to the BoomMenuButton. Customize the image resource for each button. ```java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { SimpleCircleButton.Builder builder = new SimpleCircleButton.Builder() .normalImageRes(R.drawable.jellyfish); bmb.addBuilder(builder); } ``` -------------------------------- ### Ham Button Builder with Click Listener Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Adds a click listener to a Ham Button builder to handle user interactions. The listener provides the index of the clicked button. ```java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { HamButton.Builder builder = new HamButton.Builder() .listener(new OnBMClickListener() { @Override public void onBoomButtonClick(int index) { // When the boom-button corresponding this builder is clicked. Toast.makeText(HamButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show(); } }) ``` -------------------------------- ### Add BoomMenu Dependency with Gradle Source: https://github.com/nightonke/boommenu/blob/master/README.md Include this line in your app's build.gradle file to add the BoomMenu library. ```gradle compile 'com.nightonke:boommenu:2.1.1' ``` -------------------------------- ### Set Hide Move Ease Animation Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the move animation ease for when a button re-booms (hides). The default is EaseInBack. ```Java bmb.setHideMoveEaseEnum(EaseEnum.EaseInBack); ``` -------------------------------- ### Enable Auto-Boom on Show Source: https://github.com/nightonke/boommenu/wiki/Control-BMB Configure BMB to automatically boom when it is shown. This can be set programmatically or in XML. ```java bmb.setAutoBoom(true); ``` ```xml app:bmb_autoBoom="true" ``` -------------------------------- ### Create Square Button with TextInsideCircleButton Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Use `isRound(false)` to create a square button. Configure corner radii and image/text resources as needed. ```java return new TextInsideCircleButton.Builder() .isRound(false) .shadowCornerRadius(Util.dp2px(10)) .buttonCornerRadius(Util.dp2px(10)) .normalImageRes(getImageResource()) .normalTextRes(R.string.text_inside_circle_button_text_normal); ``` -------------------------------- ### Integrating Custom Action Bar in Activity Source: https://github.com/nightonke/boommenu/wiki/Use-BMB-in-Action-Bar Code to set up a custom action bar view in an Activity's `onCreate` method. This involves inflating the custom layout and finding the BMB instances. ```java ActionBar mActionBar = getSupportActionBar(); assert mActionBar != null; mActionBar.setDisplayShowHomeEnabled(false); mActionBar.setDisplayShowTitleEnabled(false); LayoutInflater mInflater = LayoutInflater.from(this); View actionBar = mInflater.inflate(R.layout.custom_actionbar, null); TextView mTitleTextView = (TextView) actionBar.findViewById(R.id.title_text); mTitleTextView.setText(R.string.app_name); mActionBar.setCustomView(actionBar); mActionBar.setDisplayShowCustomEnabled(true); ((Toolbar) actionBar.getParent()).setContentInsetsAbsolute(0,0); BoomMenuButton leftBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_left_bmb); BoomMenuButton rightBmb = (BoomMenuButton) actionBar.findViewById(R.id.action_bar_right_bmb); ``` -------------------------------- ### Set Other Animation Attributes in Java Source: https://github.com/nightonke/boommenu/wiki/Other-Animations-Attributes-for-Buttons Use these methods to control animation delays, durations, rotation, and frame rate. Set showDelay to 0 for immediate display and showDuration to 1000ms for a 1-second show animation. Adjust frames for animation smoothness. ```java bmb.setShowDelay(0); bmb.setShowDuration(1000); bmb.setRotateDegree(1080); bmb.setHideDelay(0); bmb.setHideDuration(500); bmb.setFrames(80); ``` -------------------------------- ### Set Hide Scale Ease Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the scale animation ease for when a button re-booms using XML attributes. The default is inBack. ```XML app:bmb_hideScaleEaseEnum="inBack" ``` -------------------------------- ### Configure Pieces on BMB Source: https://github.com/nightonke/boommenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB Adjust the properties of the pieces (elements) displayed on the Boom Menu Button. This includes dot radius, ham dimensions, corner radius, and margins. ```java bmb.setDotRadius(10); bmb.setHamWidth(80); bmb.setHamHeight(20); bmb.setPieceCornerRadius(4); bmb.setPieceHorizontalMargin(10); bmb.setPieceVerticalMargin(10); bmb.setPieceInclinedMargin(20); ``` ```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" ``` -------------------------------- ### Add BoomMenu Dependency with Maven Source: https://github.com/nightonke/boommenu/blob/master/README.md Add this dependency configuration to your pom.xml file for Maven projects. ```xml com.nightonke boommenu 2.1.1 pom ``` -------------------------------- ### Add Listener to Each Button Builder Source: https://github.com/nightonke/boommenu/wiki/Click-Event-and-Listener Attach a simple click listener to each individual boom-button as it's being built. This listener will be invoked when the specific button is clicked. ```Java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { SimpleCircleButton.Builder builder = new SimpleCircleButton.Builder() .listener(new OnBMClickListener() { @Override public void onBoomButtonClick(int index) { // When the boom-button corresponding this builder is clicked. Toast.makeText(SimpleCircleButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show(); } }); bmb.addBuilder(builder); } ``` -------------------------------- ### Configure BMB Shadow Effects Source: https://github.com/nightonke/boommenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB Set shadow properties for the Boom Menu Button. Use these attributes to control the visibility, color, offset, and radius of the shadow. ```java bmb.setShadowEffect(true); bmb.setShadowColor(Color.parseColor("#55000000")); bmb.setShadowOffsetX(20); bmb.setShadowOffsetY(20); bmb.setShadowRadius(10); ``` ```xml app:bmb_shadowEffect="true" app:bmb_shadowColor="#55000000" app:bmb_shadowOffsetX="5dp" app:bmb_shadowOffsetY="5dp" app:bmb_shadowRadius="10dp" ``` -------------------------------- ### Set Button Margins in Java Source: https://github.com/nightonke/boommenu/wiki/Button-Place-Alignments Customize the margin between boom-buttons and their surroundings using Java code. This allows for more precise placement. ```java bmb.setButtonTopMargin(10); bmb.setButtonBottomMargin(10); bmb.setButtonLeftMargin(10); bmb.setButtonRightMargin(10); ``` -------------------------------- ### Set Piece Placement (PiecePlaceEnum) Source: https://github.com/nightonke/boommenu/wiki/Basic-Usage Configure how the pieces (icons or text backgrounds) are arranged on the BMB when it's in its boomed state. This affects the layout of the sub-button elements. ```java bmb.setPiecePlaceEnum(PiecePlaceEnum.DOT_3_1); ``` -------------------------------- ### Set Highlighted Image Resource for Simple Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Sets the image resource for the highlighted state of a simple circle button. This image appears when the button is pressed or focused. ```java // Set the image resource when boom-button is at highlighted-state. .highlightedImageRes(R.drawable.bat) ``` -------------------------------- ### Boom BMB Instantly Source: https://github.com/nightonke/boommenu/wiki/Control-BMB Use this method to make the boom animation play instantly without any transition. ```java bmb.boomImmediately(); ``` -------------------------------- ### Enable BMB in Fragment via XML Source: https://github.com/nightonke/boommenu/wiki/Use-BMB-in-Fragment Set this XML attribute to true in your layout file to configure BMB for use within a Fragment. This is an alternative to the programmatic approach. ```xml app:bmb_inFragment="true" ``` -------------------------------- ### Set Hide Scale Ease Animation Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the scale animation ease for when a button re-booms. The default is EaseInBack. ```Java bmb.setHideScaleEaseEnum(EaseEnum.EaseInBack); ``` -------------------------------- ### Set Normal State Color Resource for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the normal background color of the boom-button using a resource ID. ```java // The resource of color of boom-button when it is at normal-state. .normalColorRes(R.color.red) ``` -------------------------------- ### Set Text View Width Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Sets the width of the text view. ```Java // The width of text-view. .textWidth(200) ``` -------------------------------- ### Enable BMB in Fragment Programmatically Source: https://github.com/nightonke/boommenu/wiki/Use-BMB-in-Fragment Call this method on your BMB instance to enable its functionality within a Fragment. Ensure this is done after the BMB view is initialized. ```java bmb.setInFragment(true); ``` -------------------------------- ### Set Hide Rotate Ease Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the rotate animation ease for when a button re-booms using XML attributes. The default is inBack. ```XML app:bmb_hideRotateEaseEnum="inBack" ``` -------------------------------- ### Re-Boom BMB Instantly Source: https://github.com/nightonke/boommenu/wiki/Control-BMB Use this method to make the re-boom animation play instantly without any transition. ```java bmb.reboomImmediately(); ``` -------------------------------- ### Define BoomMenuButton in XML Source: https://github.com/nightonke/boommenu/wiki/Basic-Usage Add the BoomMenuButton to your XML layout file. This defines the basic structure and ID for the button. ```xml ``` -------------------------------- ### Set Highlighted State Color Resource for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the background color of the boom-button when it is in a highlighted state using a resource ID. ```java // The color of boom-button when it is at highlighted-state. .highlightedColorRes(R.color.blue) ``` -------------------------------- ### XML Layout for Ham Button Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Defines a Ham Button in an XML layout file. Use attributes to set button-enum, piece-place-enum, and button-place-enum. ```xml ``` -------------------------------- ### Define Custom Piece Positions Source: https://github.com/nightonke/boommenu/wiki/Custom-Position Add `PointF` objects to `getCustomPiecePlacePositions()` to specify the exact locations for pieces. The coordinate system's center is (0, 0). ```java bmb.getCustomPiecePlacePositions().add(new PointF(Util.dp2px(+6), Util.dp2px(-6))); bmb.getCustomPiecePlacePositions().add(new PointF(0, 0)); bmb.getCustomPiecePlacePositions().add(new PointF(Util.dp2px(-6), Util.dp2px(+6))); ``` -------------------------------- ### Implement Global Listener for BMB Source: https://github.com/nightonke/boommenu/wiki/Click-Event-and-Listener Use OnBoomListener to manage all click events and state changes for the entire Boom Menu Button in a single method. This is useful for centralized event handling. ```Java // Use OnBoomListener to listen all methods bmb.setOnBoomListener(new OnBoomListener() { @Override public void onClicked(int index, BoomButton boomButton) { // If you have implement listeners for boom-buttons in builders, // then you shouldn't add any listener here for duplicate callbacks. } @Override public void onBackgroundClick() { textViewForAnimation.setText("Click background!!!"); } @Override public void onBoomWillHide() { textViewForAnimation.setText("Will RE-BOOM!!!"); } @Override public void onBoomDidHide() { textViewForAnimation.setText("Did RE-BOOM!!!"); } @Override public void onBoomWillShow() { textViewForAnimation.setText("Will BOOM!!!"); } @Override public void onBoomDidShow() { textViewForAnimation.setText("Did BOOM!!!"); } }); ``` -------------------------------- ### Set Button Margins in XML Source: https://github.com/nightonke/boommenu/wiki/Button-Place-Alignments Customize the margin between boom-buttons and their surroundings using XML attributes. This allows for more precise placement. ```xml app:bmb_buttonTopMargin="1dp" app:bmb_buttonBottomMargin="1dp" app:bmb_buttonLeftMargin="1dp" app:bmb_buttonRightMargin="1dp" ``` -------------------------------- ### Set Highlighted State Sub-Text Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Configures the string resource for the sub-text when the boom-button is in its highlighted state. This is useful for visual feedback on interaction. ```Java // Set the sub-text resource when boom-button is at highlighted-state. .subHighlightedTextRes(R.string.text_ham_button_sub_text_highlighted) ``` -------------------------------- ### Implement Partial Listener with OnBoomListenerAdapter Source: https://github.com/nightonke/boommenu/wiki/Click-Event-and-Listener Use OnBoomListenerAdapter to selectively listen to specific methods of the Boom Menu Button's lifecycle, such as when it's about to show. ```Java // Use OnBoomListenerAdapter to listen part of methods bmb.setOnBoomListener(new OnBoomListenerAdapter() { @Override public void onBoomWillShow() { super.onBoomWillShow(); // logic here } }); ``` -------------------------------- ### Configure Cancelable and Auto-Hide Behavior in XML Source: https://github.com/nightonke/boommenu/wiki/Other-Animations-Attributes-for-Buttons Control whether the Boom Menu Button can be canceled by tapping the background after animation, or if it auto-hides after a button is clicked. Set cancelable to false to disable background cancellation. ```xml app:bmb_cancelable="false" app:bmb_autoHide="false" ``` -------------------------------- ### Configure Draggable BMB Source: https://github.com/nightonke/boommenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB Enable and configure the draggable behavior of the Boom Menu Button. Set whether it's draggable and define its insets within the parent view. ```java bmb.setDraggable(true); bmb.setEdgeInsetsInParentView(new Rect(10, 10, 10, 10)); ``` ```xml app:bmb_draggable="true" ``` -------------------------------- ### Set Piece Color Resource for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the color of the individual pieces of the boom-button using a resource ID. ```java // The resource of color of boom-button when it is just a piece. .pieceColorRes(R.color.white) ``` -------------------------------- ### Customize Simple Circle Button Shadow Corner Radius Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Sets the corner radius of the shadow for a simple circle button. This influences the shape of the shadow's edges. ```java // Set the corner-radius of the shadow. .shadowCornerRadius(Util.dp2px(20)) ``` -------------------------------- ### Set Highlighted Image Resource for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Set the image resource for the highlighted state of the text inside circle button. ```Java .highlightedImageRes(R.drawable.bat) ``` -------------------------------- ### Set Normal State Text Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the text resource for the boom-button when it is in its normal state. ```Java // Set the text resource when boom-button is at normal-state. .normalTextRes(R.string.text_ham_button_text_normal) ``` -------------------------------- ### Set Normal Image Resource for Simple Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Sets the image resource for the normal state of a simple circle button. This is the default image displayed. ```java // Set the image resource when boom-button is at normal-state. .normalImageRes(R.drawable.jellyfish) ``` -------------------------------- ### Set Boom Area to Parent View (XML) Source: https://github.com/nightonke/boommenu/wiki/Cache-Optimization-&-Boom-Area Configure BoomMenu to boom only within its parent view, rather than the whole screen, using XML attributes. ```XML app:bmb_boomInWholeScreen="false" ``` -------------------------------- ### Set Hide Rotate Ease Animation Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons Configure the rotate animation ease for when a button re-booms. The default is EaseInBack. ```Java bmb.setHideRotateEaseEnum(EaseEnum.EaseInBack); ``` -------------------------------- ### Initialize BMB in List/Recycler View Source: https://github.com/nightonke/boommenu/wiki/Use-BMB-in-List When using BMB in a list or recycler view, clear existing builders and re-add them for each item. This ensures the menu is correctly displayed for every row. ```java holder.bmb.clearBuilders(); for (int i = 0; i < holder.bmb.getPiecePlaceEnum().pieceNumber(); i++) holder.bmb.addBuilder(BuilderManager.getHamButtonBuilder()); ``` -------------------------------- ### Add Builders for Share Style BMB Source: https://github.com/nightonke/boommenu/wiki/Share-Style Add builders to the BMB for the share style. The number of builders must be between 3 and 9. Use the button number from the button place enum to control the loop. ```java for (int i = 0; i < bmb.getButtonPlaceEnum().buttonNumber(); i++) bmb.addBuilder(BuilderManager.getTextInsideCircleButtonBuilder()); ``` -------------------------------- ### Basic Text Inside Circle Button Builder Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Create and add basic text inside circle buttons using the TextInsideCircleButton.Builder. Customize text and image resources. ```Java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { TextInsideCircleButton.Builder builder = new TextInsideCircleButton.Builder() .normalImageRes(R.drawable.butterfly) .normalText("Butter Doesn't fly!"); bmb.addBuilder(builder); } ``` -------------------------------- ### Set Highlighted State Text Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the text resource for the boom-button when it is in its highlighted state. ```Java // Set the text resource when boom-button is at highlighted-state. .highlightedTextRes(R.string.text_ham_button_text_highlighted) ``` -------------------------------- ### Define Custom Button Positions Source: https://github.com/nightonke/boommenu/wiki/Custom-Position Add `PointF` objects to `getCustomButtonPlacePositions()` to specify the exact locations for boom-buttons. The coordinate system's center is (0, 0). ```java bmb.getCustomButtonPlacePositions().add(new PointF(Util.dp2px(-80), Util.dp2px(-80))); bmb.getCustomButtonPlacePositions().add(new PointF(0, 0)); bmb.getCustomButtonPlacePositions().add(new PointF(Util.dp2px(+80), Util.dp2px(+80))); ``` -------------------------------- ### Set Normal State Sub-Text Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Configures the string resource for the sub-text when the boom-button is in its normal state. Ensure the resource ID is valid. ```Java // Set the sub-text resource when boom-button is at normal-state. .subNormalTextRes(R.string.text_ham_button_sub_text_normal) ``` -------------------------------- ### Add Builder to Boom Menu Button Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Adds a configured builder to the Boom Menu Button instance. This step is necessary after defining all desired properties. ```Java bmb.addBuilder(builder); } ``` -------------------------------- ### Configure Cancelable and Auto-Hide Behavior in Java Source: https://github.com/nightonke/boommenu/wiki/Other-Animations-Attributes-for-Buttons Control whether the Boom Menu Button can be canceled by tapping the background after animation, or if it auto-hides after a button is clicked. Set cancelable to false to disable background cancellation. ```java bmb.setCancelable(false); bmb.setAutoHide(false); ``` -------------------------------- ### Set Text View Height Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Sets the height of the text view. ```Java // The height of text-view .textHeight(50) ``` -------------------------------- ### Set Highlighted State Text Resource Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Sets the text resource for the boom-button when it is in its highlighted state. ```Java // Set the text resource when boom-button is at highlighted-state. .highlightedTextRes(R.string.text_outside_circle_button_text_highlighted) ``` -------------------------------- ### Set Highlighted State Color for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the background color of the boom-button when it is in a highlighted state using a Color object. ```java // The color of boom-button when it is at highlighted-state. .highlightedColor(Color.BLUE) ``` -------------------------------- ### Set Boom Area to Parent View (Programmatic) Source: https://github.com/nightonke/boommenu/wiki/Cache-Optimization-&-Boom-Area Configure BoomMenu to boom only within its parent view, rather than the whole screen. This is done programmatically. ```Java bmb1.setBoomInWholeScreen(false); ``` -------------------------------- ### Set Normal State Color for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the normal background color of the boom-button using a Color object. ```java // The color of boom-button when it is at normal-state. .normalColor(Color.RED) ``` -------------------------------- ### Set Button Width Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Specifies the width of the boom-button in pixels. Use utility functions like Util.dp2px for density-independent sizing. ```Java // Set the width of boom-button, in pixel. .buttonWidth(Util.dp2px(300)) ``` -------------------------------- ### Set Unable Image Resource for Simple Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Sets the image resource for the unable state of a simple circle button. This image is displayed when the button is disabled. ```java // Set the image resource when boom-button is at unable-state. .unableImageRes(R.drawable.butterfly) ``` -------------------------------- ### Set Piece Color for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the color of the individual pieces of the boom-button using a Color object. ```java // The color of boom-button when it is just a piece. .pieceColor(Color.WHITE) ``` -------------------------------- ### Set Normal State Text Resource Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Sets the text resource for the boom-button when it is in its normal state. ```Java // Set the text resource when boom-button is at normal-state. .normalTextRes(R.string.text_outside_circle_button_text_normal) ``` -------------------------------- ### Set Unable State Color Resource for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the background color of the boom-button when it is in an unable state using a resource ID. ```java // The resource of color of boom-button when it is at unable-state. .unableColorRes(R.color.black) ``` -------------------------------- ### Set Normal State Text Color Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the color resource for the text of the boom-button when it is in its normal state. ```Java // Set the resource of color of text when boom-button is at normal-state. .normalTextColorRes(R.color.black) ``` -------------------------------- ### Set Button Placement (ButtonPlaceEnum) Source: https://github.com/nightonke/boommenu/wiki/Basic-Usage Define how the sub-buttons themselves are positioned on the screen when the BMB is boomed. This controls the overall arrangement of the interactive elements. ```java bmb.setButtonPlaceEnum(ButtonPlaceEnum.SC_3_3); ``` -------------------------------- ### Add Builders for Sub-Buttons Source: https://github.com/nightonke/boommenu/wiki/Basic-Usage Create and add builders for customizing individual sub-buttons. The number of builders must match the number specified by the piece and button placement enums. ```java for (int i = 0; i < bmb.getButtonPlaceEnum().buttonNumber(); i++) { bmb.addBuilder(new SimpleCircleButton.Builder() .normalImageRes(R.drawable.jellyfish)); } ``` -------------------------------- ### Customize Simple Circle Button Shadow Color Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Sets the color of the shadow for a simple circle button. Use a valid color string format. ```java // Set the color of the shadow of boom-button. .shadowColor(Color.parseColor("#ee000000")) ``` -------------------------------- ### Configure BMB Button Properties Source: https://github.com/nightonke/boommenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB Customize the appearance of individual buttons within the Boom Menu Button. This includes radius, ripple effect, and various color settings. ```java bmb.setButtonRadius(Util.dp2px(40)); bmb.setRippleEffect(false); bmb.setNormalColor(Color.BLACK); bmb.setHighlightedColor(Color.BLUE); bmb.setUnableColor(Color.WHITE); ``` ```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" ``` -------------------------------- ### Configure Background Dim Color Source: https://github.com/nightonke/boommenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB Set the color of the background dim effect that appears when the Boom Menu Button is in its booming state. ```java bmb.setDimColor(Color.parseColor("#55000000")) ``` ```xml app:bmb_dimColor="#55000000" ``` -------------------------------- ### Set Shadow Corner Radius for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Set the corner radius of the shadow for the text inside circle button. ```Java .shadowCornerRadius(Util.dp2px(20)) ``` -------------------------------- ### Custom Action Bar Layout with BMBs Source: https://github.com/nightonke/boommenu/wiki/Use-BMB-in-Action-Bar XML layout for a custom action bar that includes two Boom Menu Buttons (left and right). Ensure `bmb_backgroundEffect` is set to `false` for action bar integration. ```xml ``` -------------------------------- ### Set Text Rectangle Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Configures the position and size of the text view within the boom-button. This method allows precise control over the text's bounding box. ```Java // Set the rect of text. // By this method, you can set the position and size of the text-view in boom-button. // For example, builder.textRect(new Rect(0, 50, 100, 100)) will make the // text-view's size to be 100 * 50 and margin-top to be 50 pixel. .textRect(new Rect(Util.dp2px(70), Util.dp2px(10), Util.dp2px(280), Util.dp2px(40))) ``` -------------------------------- ### Set Share Style Piece Place Enum Source: https://github.com/nightonke/boommenu/wiki/Share-Style Configure the BMB to use the share-style layout. This can be done programmatically or via XML attributes. ```java bmb1.setPiecePlaceEnum(PiecePlaceEnum.Share); ``` ```xml app:bmb_piecePlaceEnum="piecePlace_share" ``` -------------------------------- ### XML Layout for Text Outside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Add this BoomMenuButton to your XML layout. Ensure you set the buttonEnum to 'textOutsideCircle'. ```xml ``` -------------------------------- ### Set Unable State Text Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the text resource for the boom-button when it is in its unable state. ```Java // Set the text resource when boom-button is at unable-state. .unableTextRes(R.string.text_ham_button_text_unable) ``` -------------------------------- ### Basic Text Outside Circle Button Builder Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Create and add basic text outside circle buttons to the Boom Menu. This snippet sets the image and text for each button. ```java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { TextOutsideCircleButton.Builder builder = new TextOutsideCircleButton.Builder() .normalImageRes(R.drawable.butterfly) .normalText("Butter Doesn't fly!"); bmb.addBuilder(builder); } ``` -------------------------------- ### Set Highlighted State Text Color Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the color resource for the text of the boom-button when it is in its highlighted state. ```Java // Set the resource of color of text when boom-button is at highlighted-state. .highlightedTextColorRes(R.color.blue) ``` -------------------------------- ### Customize Simple Circle Button Click Listener Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Adds a click listener to a simple circle button builder. This code snippet shows how to define the action to be performed when a button is clicked. ```java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { SimpleCircleButton.Builder builder = new SimpleCircleButton.Builder() .listener(new OnBMClickListener() { @Override public void onBoomButtonClick(int index) { // When the boom-button corresponding this builder is clicked. Toast.makeText(SimpleCircleButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show(); } }) ``` -------------------------------- ### Set Text Rectangle Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Defines the position and size of the text-view within the boom-button. The Rect parameters are (left, top, right, bottom). ```Java // Set the rect of text. // By this method, you can set the position and size of the text-view in boom-button. // For example, builder.textRect(new Rect(0, 50, 100, 100)) will make the // text-view's size to be 100 * 50 and margin-top to be 50 pixel. .textRect(new Rect(Util.dp2px(15), Util.dp2px(52), Util.dp2px(65), Util.dp2px(72))) ``` -------------------------------- ### Set Button Height Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Specifies the height of the boom-button in pixels. Use utility functions like Util.dp2px for density-independent sizing. ```Java // Set the height of boom-button, in pixel. .buttonHeight(Util.dp2px(60)); ``` -------------------------------- ### Ease Enum Definitions Source: https://github.com/nightonke/boommenu/wiki/Ease-Animations-for-Buttons List of available ease animation enumerations that can be used in XML. Each enum defines a specific animation curve. ```XML ``` -------------------------------- ### Set Normal Image Resource for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Set the image resource for the normal state of the text inside circle button. ```Java .normalImageRes(R.drawable.jellyfish) ``` -------------------------------- ### Set Boom Enum via XML Source: https://github.com/nightonke/boommenu/wiki/Different-Ways-to-Boom Configure the boom animation enum for the Boom Menu using XML attributes. ```xml app:bmb_boomEnum="boomHorizontalThrow_1" ``` -------------------------------- ### Enable 3D Transform Animation in Java Source: https://github.com/nightonke/boommenu/wiki/Other-Animations-Attributes-for-Buttons Enable or disable the use of a 3D transform animation for booming and rebooming effects. Set to true to activate 3D animations. ```java bmb.setUse3DTransformAnimation(true); ``` -------------------------------- ### Set Button Radius for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Set the overall radius of the boom-button in pixels. ```java // The radius of boom-button, in pixel. .buttonRadius(Util.dp2px(40)) ``` -------------------------------- ### Set Text Ellipsize Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets how the text should be truncated if it exceeds the available space in the boom-button's text view. Supports various truncation methods. ```Java // Set the ellipsize of the text-view. .ellipsize(TextUtils.TruncateAt.MIDDLE) ``` -------------------------------- ### Set Bottom Ham Button Top Margin (Java) Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets a custom top margin for the bottom-most Ham Button. This is useful for creating spacing between the last button and the one above it. ```Java bmb.setBottomHamButtonTopMargin(Util.dp2px(50)); ``` -------------------------------- ### Customize Simple Circle Button Shadow Radius Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Sets the radius of the shadow for a simple circle button. This affects the blurriness and spread of the shadow. ```java // Set the radius of shadow of the boom-button. .shadowRadius(Util.dp2px(20)) ``` -------------------------------- ### Boom BMB Programmatically Source: https://github.com/nightonke/boommenu/wiki/Control-BMB Call this method to trigger the boom animation of the BMB. ```java bmb.boom(); ``` -------------------------------- ### Configure Boom-Buttons Margins on BMB Source: https://github.com/nightonke/boommenu/wiki/Attributes-for-BMB-or-Pieces-on-BMB Set the margins for the boom-buttons when they are displayed on the Boom Menu Button. This controls horizontal, vertical, and inclined spacing. ```java bmb.setButtonHorizontalMargin(50); bmb.setButtonVerticalMargin(40); bmb.setButtonInclinedMargin(100); ``` ```xml app:bmb_buttonHorizontalMargin="20dp" app:bmb_buttonVerticalMargin="20dp" app:bmb_buttonInclinedMargin="30dp" ``` -------------------------------- ### Set Text Size Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets the font size for the text displayed in the boom-button. The size is specified in density-independent pixels (sp). ```Java // Set the text size of the text-view. .textSize(10) ``` -------------------------------- ### Enable 3D Transform Animation in XML Source: https://github.com/nightonke/boommenu/wiki/Other-Animations-Attributes-for-Buttons Enable or disable the use of a 3D transform animation for booming and rebooming effects. Set to true to activate 3D animations. ```xml app:bmb_use3DTransformAnimation="true" ``` -------------------------------- ### Customize Share Style BMB Properties Source: https://github.com/nightonke/boommenu/wiki/Share-Style Optionally customize the visual properties of the share-style BMB, such as line length, line width, dot radius, and line colors. These can be set programmatically or via XML. ```java bmb.setShareLineLength(45); bmb.setShareLineWidth(5); bmb.setDotRadius(12); bmb.setShareLine1Color(Color.BLACK); bmb.setShareLine2Color(Color.BLACK); ``` ```xml app:bmb_sharedLineLength="10dp" app:bmb_shareLineWidth="2dp" app:bmb_dotRadius="4dp" app:bmb_shareLine1Color="@android:color/holo_orange_light" app:bmb_shareLine2Color="@android:color/holo_orange_dark" ``` -------------------------------- ### Set Normal State Text Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the direct text content for the boom-button when it is in its normal state. ```Java // Set the text when boom-button is at normal-state. .normalText("Put your normal text here") ``` -------------------------------- ### Set Unable State Color for Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Configure the background color of the boom-button when it is in an unable state using a Color object. ```java // The color of boom-button when it is at unable-state. .unableColor(Color.BLACK) ``` -------------------------------- ### XML Layout for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Define the BoomMenuButton in your XML layout, specifying the button type and placement enums. ```XML ``` -------------------------------- ### Enable Shadow Effect for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Enable the shadow effect for the text inside circle button. ```Java .shadowEffect(true) ``` -------------------------------- ### Set Text Gravity Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets the gravity for the text view within the boom-button. This determines the alignment of the text. ```Java // Set the gravity of text-view. .textGravity(Gravity.CENTER) ``` -------------------------------- ### Set Image Rect for Simple Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Defines the position and size of the image view within a simple circle button. The Rect parameters specify left, top, right, and bottom coordinates. ```java // 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 Unable State Text Resource Source: https://github.com/nightonke/boommenu/wiki/Text-Outside-Circle-Button Sets the text resource for the boom-button when it is in its unable state. ```Java // Set the text resource when boom-button is at unable-state. .unableTextRes(R.string.text_outside_circle_button_text_unable) ``` -------------------------------- ### Set Highlighted State Text Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the direct text content for the boom-button when it is in its highlighted state. ```Java // Set the text when boom-button is at highlighted-state. .highlightedText("Put your highlighted text here") ``` -------------------------------- ### Text Inside Circle Button with Click Listener Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Add a click listener to the text inside circle button builder to handle user interactions. ```Java for (int i = 0; i < bmb.getPiecePlaceEnum().pieceNumber(); i++) { TextInsideCircleButton.Builder builder = new TextInsideCircleButton.Builder() .listener(new OnBMClickListener() { @Override public void onBoomButtonClick(int index) { // When the boom-button corresponding this builder is clicked. Toast.makeText(TextInsideCircleButtonActivity.this, "Clicked " + index, Toast.LENGTH_SHORT).show(); } }) ``` -------------------------------- ### Set Normal State Text Color Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the color of the text for the boom-button when it is in its normal state. ```Java // Set the color of text when boom-button is at normal-state. .normalTextColor(Color.BLACK) ``` -------------------------------- ### Horizontal Button Placement for Ham Button Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Configures Ham Buttons to arrange in a horizontal line. The buttonNumber() method returns Integer.MAX_VALUE for this enum. ```Java ButtonPlaceEnum.Horizontal ``` -------------------------------- ### Set Text Typeface Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets the typeface for the text displayed in the boom-button. This affects the font style of the text. ```Java // Set the typeface of the text. .typeface(Typeface.DEFAULT_BOLD) ``` -------------------------------- ### Set Image Padding for Simple Circle Button Source: https://github.com/nightonke/boommenu/wiki/Simple-Circle-Button Controls the padding around the content within the image view of a simple circle button. This affects the spacing between the image and its container. ```java // 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)) ``` -------------------------------- ### Ham Button Shadow Corner Radius Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets the corner radius of the shadow for a Ham Button. This affects the shape of the shadow's corners. ```java // Set the corner-radius of the shadow. .shadowCornerRadius(Util.dp2px(5)) ``` -------------------------------- ### Set Unable State Text Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the direct text content for the boom-button when it is in its unable state. ```Java // Set the text when boom-button is at unable-state. .unableText("Unable!") ``` -------------------------------- ### Set Unable Image Resource for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Set the image resource for the unable state of the text inside circle button. ```Java .unableImageRes(R.drawable.butterfly) ``` -------------------------------- ### Set Shadow Radius for Text Inside Circle Button Source: https://github.com/nightonke/boommenu/wiki/Text-Inside-Circle-Button Set the radius of the shadow for the text inside circle button. ```Java .shadowRadius(Util.dp2px(20)) ``` -------------------------------- ### Vertical Button Placement for Ham Button Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Configures Ham Buttons to arrange in a vertical line. The buttonNumber() method returns Integer.MAX_VALUE for this enum. ```Java ButtonPlaceEnum.Vertical ``` -------------------------------- ### Set Highlighted State Sub-Text String Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Sets the literal string content for the sub-text when the boom-button is in its highlighted state. Allows for custom text during interaction. ```Java // Set the sub-text when boom-button is at highlighted-state. .subHighlightedText("Put your highlighted sub-text here") ``` -------------------------------- ### Set Unable State Text Color Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Use this to set the color resource for the text of the boom-button when it is in its unable state. ```Java // Set the resource of color of text when boom-button is at unable-state. .unableTextColorRes(R.color.red) ``` -------------------------------- ### Set Unable State Sub-Text Resource Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Configures the string resource for the sub-text when the boom-button is in an unable or disabled state. This provides clear indication of the button's status. ```Java // Set the sub-text resource when boom-button is at unable-state. .subUnableTextRes(R.string.text_ham_button_sub_text_unable) ``` -------------------------------- ### Set Text Padding Source: https://github.com/nightonke/boommenu/wiki/Ham-Button Controls the padding within the text view of the boom-button. This method allows for adjusting the space between the text content and its boundaries. ```Java // 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)) ```