Closed osfunapps closed 3 years ago
Hey @osfunapps,
To add a FabOption programmatically, call the addView variant that only takes in the single child View to add (or call the addViews method, which takes in zero or more children). Don't bother dealing with the overloaded addView variant that also accepts the index and LayoutParams, as you use in your example. The platform will handle that for you. So your code should look like:
fabLayout.addView(option)
or fabLayout.addViews(option)
(note the s
in the 2nd code example).
Please note that the added FabOption will be appended to the end of the list (so it will be at the top if FabOptionPosition on your ExpandableFab is set to ABOVE
or at the bottom if FabOptionPosition is set to BELOW
). At this time, the library does not allow you to set the specific index within the list of FabOptions for a given ExpandableFabLayout.
Hey @osfunapps, did the above help solve your issue?
Thanks for your help.
unfortunately that didnt solve my problem. The Option is still seen only half way.
I used a very old fab library instead.
Hey,
I have, in my XML:
And I'm trying, via code, to add the option like so:
But the option isn't scaled properly on screen, probably because I'm not adding the option right or something.
I can refresh myself the ExpandableFabLayout but I thought that maybe I'm not adding the FabOption right.