class FabOption : FloatingActionButton
The design and behavior of a single option within an ExpandableFab.
Developer Notes:
Implementation Notes:
Since
1.0.0
<init> |
Used to create a FabOption programmatically (do not use the other constructor FabOption(context, attributeSet) - it is for use by the Android framework when inflating a FabOption via XML). This constructor keeps all optional properties of a FabOption at their default values, though you can always change these values after instantiation by using the appropriate setter methods (with the exception of orientation, which cannot be changed after instantiation). FabOption(context: Context, orientation: Orientation? = Orientation.PORTRAIT)
Called by the system when creating a FabOption via XML (don't call this directly). To create a FabOption programmatically, use the FabOption(context, orientation) constructor. FabOption(context: Context, attributeSet: AttributeSet) |
closingAnimationDurationMs |
The duration (in milliseconds as a positive long) of the animations that will be played when this FabOption is being hidden from a visible state (when the ExpandableFab is closing). Default value is 75L. var closingAnimationDurationMs: Long |
fabOptionColor |
The color of the FabOption. Default value is your app's colorAccent. var fabOptionColor: Int |
fabOptionEnabled |
The enabled state of this FabOption and its label. Disabled FabOptions and labels will be visually distinct and unclickable. Default value is true (enabled). var fabOptionEnabled: Boolean |
fabOptionIcon |
The drawable to show as the FabOption's icon. Default value is null (no icon shown). var fabOptionIcon: Drawable? |
label |
The optional label attached to this FabOption. The label will only be shown when its labelText is not null. Default values for the label are as follows: val label: Label |
openingAnimationDurationMs |
The duration (in milliseconds as a positive long) of the animations that will be played when this FabOption is being shown from a hidden state (when the ExpandableFab is opening). Default value is 125L. var openingAnimationDurationMs: Long |
openingOvershootTension |
The tension (as a positive float) in an OvershootInterpolator applied on the FabOption when it's playing its animations for being shown from a hidden state (when the ExpandableFab is opening). The OvershootInterpolator allows us to have an animation where the FabOption will grow past its regular size when initially appearing, before smoothly shrinking down to regular size. Larger values will exaggerate the effort more. Default value is 3.5f. var openingOvershootTension: Float |
orientation |
The Orientation this FabOption is viewable in. Default value is Orientation.PORTRAIT. var orientation: Orientation |
setOnClickListener |
Registers a callback to be invoked when this FabOption or its label is clicked. The default behavior the FabOption will be executed before this custom callback. fun setOnClickListener(onClickListener: OnClickListener?): Unit |
setSize |
Sets the size of the FabOption. Overridden to ensure we never set the size to be FabSize.CUSTOM. fun setSize(size: Int): Unit |