Content:
- Examples ##
- Properties
- Methods

A Floating Action Button (FAB) is a prominent, circular button that hovers above the content, typically used for a primary action in an application.

fab = ui.addFloatingActionButton( parent, icon, options, text ) → ui object: FloatingActionButton

If you want the fab to position relative to the layout and not on the bottom right corner, pass a Static option. If fab is Extended pass a text argument.

Here are the available methods for the Floating Action Button.

Examples ##

#Example - Basic FABclass Main extends App{onStart(){// Create a fullscreen linear layout with objects vertically centeredthis.main = ui.addLayout("main", "Linear", "VCenter,FillXY")// Add a floating action button to the main layout.// By default, FAB is positioned fix at the bottom right cornerthis.fab = ui.addFAB(this.main, "add")// Add a callback handler for onTouch event on the FABthis.fab.setOnTouch( this.onTouch )}onTouch(){ui.showPopup( "You click me!" )}}

Example - Primary static FAB click to expand contents 

Example - Extended FAB click to expand contents 

Example - Secondary,Extended,Left click to expand contents 

Properties

The following properties are available on the FloatingActionButton object:

absHeightNumber
absLeftNumber
absTopNumber
absWidthNumber
backColorString
backImageString
borderNumber
borderColorString
borderStyleString
colorString
cornerRadiusNumber
disabledBoolean
disabledRippleBoolean
elObject
elStyleString
fontFileString
heightNumber
iconString
iconSizeNumber
isVisibleBoolean
leftNumber
marginsList
opacityNumber
optionsString
paddingList
parentObject
positionObject
rotationNumber
sizeVariantString
textString
textColorString
textSizeNumber
topNumber
typeString
variantString
visibilityString
widthNumber

Methods

The following methods are available on the FloatingActionButton object:

getPosition( options ) → Object
gone()
hide()
setScale( x, y )
show()