nambicompany / expandable-fab

A highly customizable 'speed dial' FloatingActionButton implementation.
https://nambicompany.github.io/expandable-fab/
MIT License
199 stars 20 forks source link

Feature Improvement #5

Closed kahan-sonani closed 3 years ago

kahan-sonani commented 3 years ago

Right now I can't customize the padding/margin between FabOptions using app:layout_margin and android:padding attributes in XML.

kabumere commented 3 years ago

Hey @kahan-sonani,

Are these two attributes what you're looking for:

efab_firstFabOptionMarginPx (defined on the ExpandableFab view, NOT the individual FabOptions)

The margin (in pixels as a positive float) between the first FabOption in this orientation and the ExpandableFab itself. Depending on the size you set for the ExpandableFab, you may want this margin to be different than [successiveFabOptionMarginPx]. Default value is 80f. Reference in XML: https://github.com/nambicompany/expandable-fab/blob/master/library/src/main/res/values/attrs.xml#L216

and

efab_successiveFabOptionMarginPx (defined on the ExpandableFab view, NOT the individual FabOptions)

The margin (in pixels as a positive float) between successive FabOptions in this ExpandableFab orientation. See [firstFabOptionMarginPx] if trying to set the margin between the first FabOption in this orientation and the ExpandableFab itself. Default value is 75f. Reference in XML: https://github.com/nambicompany/expandable-fab/blob/master/library/src/main/res/values/attrs.xml#L224

In short, the first lets you set the margin between the ExpandableFab and the first FapOption. The second lets you set the margins between the rest of the FapOptions. They're both defined on the ExpandableFab and NOT the FabOption, because every FabOption in an orientation must use the same margin between eachother. You can only supply a positive float, because fabOptionPosition (https://github.com/nambicompany/expandable-fab/blob/master/library/src/main/res/values/attrs.xml#L205) already determines whether FabOptions are displayed upwards or downwards.

Let me know if that is the functionality you were looking for.

kahan-sonani commented 3 years ago

Yeah this was the one I was looking for and thanks, and sorry that I misread the documentation