[Free] FloatActionBtn

FloatActionBtn Extension – Documentation

Author: Kenneth Morales
Description:
A customizable Floating Action Button (FAB) for App Inventor platforms with:
:white_check_mark: Custom PNG icon support (from assets)
:white_check_mark: Default plus (+) icon
:white_check_mark: Customizable size, background color, icon color
:white_check_mark: Positioning (top-left, top-right, bottom-left, bottom-right)
:white_check_mark: Padding control
:white_check_mark: Press/touch effect
:white_check_mark: Clear & Active tracking (avoid duplicates on reload)


Blocks Overview

Functions

  • CreateFAB
    CreateFAB_Call_Method

➝ Creates and displays the floating button.
(Call this after setting size, color, icon, position, padding)

  • Clear
    Clear_Call_Method

➝ Removes the floating button from screen.
(Use this before creating again, or when reloading a screen)

  • SetSize (sizePx)
    SetSize_Call_Method

➝ Sets FAB size in pixels.

  • SetBackgroundColor (hexColor)
    SetBackgroundColor_Call_Method

➝ Sets the button’s background color. Example: #FF5722.

  • SetPlusColor (hexColor)
    SetPlusColor_Call_Method

➝ Sets the plus (+) icon color (if using default plus).

  • SetIconAsset (assetName, sizePx)
    SetIconAsset_Call_Method

➝ Replaces the plus icon with an image from your App Inventor Media assets.
Example: SetIconAsset("icon.png", 150).

  • SetPosition (pos)
    SetPosition_Call_Method

➝ Sets FAB position: "topleft", "topright", "bottomleft", "bottomright".

  • SetPadding (left, top, right, bottom)
    SetPadding_Call_Method

➝ Adjusts button offset from screen edges.


Properties

  • IsActive (read-only)
    IsActive_Get_Property

➝ Returns true if the FAB is currently visible on screen.


Events

  • Touch
    Touch_Event

➝ Fires when the FAB is pressed.

Sample Output

Sample Blocks

License: Developed by Kenneth Morales using Fast builder.
You can download the aix extension provided bellow.
FloatActionBtn aix extension Download Link:
Current version:
com.kenmor.floatactionbtn.aix (13.6 KB)

2 Likes

Good.

Could do with helper blocks for the positions, and accept AI2 color blocks/numbers for the background/plus. Also id system for showing more than one FAB ? (or I guess one just drags out another instance of the extension...)

3 Likes

Hi @TIMAI2 yes of course I'll do it later for the next revision. Thank you for the suggestion :grin: .

2 Likes

Great extension ! I use it to create a small page close button. The problem is, the button appears on all pages. I just need to delete it when the other pages are initialized.
Perhaps you could add an option to indicate where to place this button, a page or an alignment ?
Sorry for my English, I'm using an online translator...
Thanks for your work !

Hi you can use clear block.