Expandable Fab Layout
The container and controller for all children views of the ExpandableFab widget (Overlay, ExpandableFab, FabOption, Label). The ExpandableFabLayout handles the bulk of the functionality for the ExpandableFab widget as a whole (from coordinating opening and closing animations to screen orientation changes, etc). See below for an example on how to easily set up the ExpandableFab widget using the ExpandableFabLayout as the containing ViewGroup.
Protip: If you only set a single ExpandableFab widget, it will automatically be used for both portrait and landscape orientations. No need to set duplicate views if you would like the same widget in both orientations. If you would like two different widgets for portrait and landscape however, you can do so by explicitly defining different orientations for the different sets of widget views. In the example below we don't set orientation for any of the views, so they default to 'portrait'. However, since we didn't explicitly set landscape views, the widget will actually be used for both portrait and landscape.
ExpandableFab widget Example via XML:
Developer Notes:
The ExpandableFabLayout should be given a layout_width and layout_height of match_parent, and it should be a child of a ViewGroup that has access to draw over the full screen as well. This is necessary as some views of the widget (like the Overlay) may need the ability to draw over the full screen. Setting the dimensions as such will not impede the viewability, clickability or focusability of any other views in your layout.
Implementation Notes:
Since the Kotlin 'internal' modifier translates to 'public' in Java, the JvmSynthetic annotation is used on those functions and properties to hide them from the published API for Java clients. A proper solution to this issue would be a package-private visibility modifier, but Kotlin has yet to implement it (https://youtrack.jetbrains.com/issue/KT-29227). Until then, the JvmSynthetic annotations should remain in order to present the proper published API to both Java & Kotlin clients.
Since
1.0.0
Constructors
Used to create an ExpandableFabLayout programmatically (do not use the other constructor ExpandableFabLayout(context, attributeSet) - it is for use by the Android framework when inflating an ExpandableFabLayout via XML).
Called by the system when creating an ExpandableFabLayout via XML (don't call this directly). To create an ExpandableFabLayout programmatically, use the ExpandableFabLayout(context) constructor.
Functions
Adds a child view with the specified layout parameters to the ExpandableFabLayout.
Attempts to close the ExpandableFab, playing the appropriate animations in the process. If the ExpandableFab is not in a position to close (it's still playing its opening animations), it will remind itself to close once it is able.
Returns the OrientationConfiguration showing for the current screen orientation. An OrientationConfiguration is just a holder for all the views of an ExpandableFab widget in a specific Orientation.
Removes all child views in both portrait and landscape orientation from the ExpandableFabLayout.
Properties
The duration (in milliseconds as a positive long) of the hidden to visible state animations for ALL the Labels inside of this ExpandableFabLayout. A convenience method so that clients don't have to set the same value for every Label within a single ExpandableFabLayout. This property will affect Labels on ExpandableFabs AND FabOptions.
The duration (in milliseconds as a positive long) of the visible to hidden state animations for ALL the Labels inside of this ExpandableFabLayout. A convenience method so that clients don't have to set the same value for every Label within a single ExpandableFabLayout. This property will affect Labels on ExpandableFabs AND FabOptions.