Difference between revisions of "Trigger: Floating Button"

 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===<p><b>About</b></p>===
+
<pre class="header-style">The Floating Button trigger displays an interactive button on the screen that can be pressed to activate a macro. The button's visibility is controlled by enabling or disabling the macro or trigger. Dragging the button over the bin icon will result in the macro or trigger being disabled (as configured).</pre>
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
''' Options '''
This trigger will display a floating button on the screen that can be clicked to activate a macro.
 
  
To show and hide the button, the macro must be activated or deactivated accordingly.
+
* '''Identifier''': A unique ID for referencing the button in actions, enabling control across multiple macros. This is displayed in brackets after the trigger name.
  
If the button is dragged over the trash can icon, the macro will be deactivated (set by default).
+
* '''Icon Type''':
</pre>
+
** '''Use Icon''': Select an icon from apps, user images, MacroDroid icons, or Material Design library
 +
** '''Use Text''': Display text characters on the button (up to 8 characters), with customizable text color. Supports magic text.
  
==<p><b>Supported configurations</b></p>==
+
* '''Background Color''': Select a custom background color for the button, or use transparent background
  
=== Identifier ===
+
* '''Icon Padding''': Adjust the padding around the icon within the button (shown as percentage)
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
* '''Opacity''': Set the transparency level of the button (0-100%)
It is an id that will serve you later when you use the "Configure floating button" action to identify the button that will be configured in the same macro or another macro.
 
</pre>
 
  
=== Icon ===
+
* '''Size''': Choose between normal or mini (small) size variants
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
* '''Show on Lock Screen''': When enabled, the button will be visible on the lock screen (not available on Android 8.0 and above)
It allows you to use installed application icons, user icons (own images), macrodroid icons, as well as notification and material design.
 
</pre>
 
  
=== Set background ===
+
* '''Prevent Removal by Dragging to Bin''': When enabled, the button cannot be removed by dragging it to the trash icon
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
* '''Disable Macro/Trigger on Remove''': When the button is dragged to the trash icon, choose whether to disable the entire macro or just the trigger
Use a background color below the icon.
 
</pre>
 
  
=== Transparent background ===
+
* '''Vibrate on Press''': Enable haptic feedback when the button is pressed
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
* '''Force Location When Enabled''': Specify exact X and Y coordinates for the button position when the macro is enabled
Show the floating button without a background color.
+
** Coordinates can be specified in pixels or as a percentage of screen size
</pre>
+
** Supports magic text and variables for dynamic positioning
  
=== Padding ===
+
* '''Fixed Location''': Prevents the button from being dragged to a new position
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
''' Examples '''
Change a larger or smaller icon padding.
 
</pre>
 
  
=== Opacity ===
+
''Example 1: Quick Screenshot Button''
 +
  <pre class="trigger-style">Triggers
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
Floating Button (screenshot_btn)</pre>
Change the opacity, higher or lower.
+
  <pre class="action-style">Actions
</pre>
 
  
=== Normal or Small ===
+
Take Screenshot</pre>
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
This creates a floating button that takes a screenshot when pressed. The identifier "screenshot_btn" allows other macros to control this button.
Toggling between 2 different sizes of floating button.
 
</pre>
 
  
=== Disable macro on remove ===
+
''Example 2: Toggle Flashlight''
 +
  <pre class="trigger-style">Triggers
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
Floating Button (flashlight)</pre>
This is the default option for the hover button when you drag the hover button to the recycle bin
+
  <pre class="action-style">Actions
(it will appear when you start dragging the button)
 
you can also toggle it by simply deactivating the toggle
 
(it can be re-enabled manually or with the "set floating button action").
 
</pre>
 
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
 
An alternative option is to deactivate the trigger by removing the floating button.
 
</pre>
 
* ''''' You are interested in  ''''' '''''[https://macrodroidforum.com/wiki/index.php/Action:_Floating_Button_Configure Set floating button action]'''''
 
  
=== Force location when enabled ===
+
Torch Toggle</pre>
  
<pre style="background-color: #ACC8E5; color: #112A46; border-radius: 10px; padding: 10px;">
+
A floating button that toggles the device's flashlight/torch on and off.
Whenever this box is checked the floating button will appear at the specified coordinates, otherwise it will appear in the centre of the screen.
+
 
Now supports using magic text to define the location when enabled (needs an integer variable).
+
''' Notes '''
</pre>
+
 
 +
* This trigger requires the "Draw over other apps" (overlay) permission.
 +
* The button remembers its last position when hidden, unless "Force Location When Enabled" is configured.
 +
* Multiple floating buttons can exist simultaneously if they have different identifiers.
 +
* Use the [[Action:_Floating_Button_Configure|Floating Button Configure action]] to dynamically modify button appearance and position.
 +
* Icons can be selected from app icons, user-uploaded images, MacroDroid's built-in icons, or Material Design icons.
 +
* Text icons support magic text, allowing dynamic text based on variables or system values.
 +
 
 +
''' See Also '''
 +
 
 +
* [[Action:_Floating_Button_Configure|Floating Button Configure action]]
 +
* [[Action:_Enable/Disable_Macro|Enable/Disable Macro action]]

Latest revision as of 23:01, 5 January 2026

The Floating Button trigger displays an interactive button on the screen that can be pressed to activate a macro. The button's visibility is controlled by enabling or disabling the macro or trigger. Dragging the button over the bin icon will result in the macro or trigger being disabled (as configured).

Options

  • Identifier: A unique ID for referencing the button in actions, enabling control across multiple macros. This is displayed in brackets after the trigger name.
  • Icon Type:
    • Use Icon: Select an icon from apps, user images, MacroDroid icons, or Material Design library
    • Use Text: Display text characters on the button (up to 8 characters), with customizable text color. Supports magic text.
  • Background Color: Select a custom background color for the button, or use transparent background
  • Icon Padding: Adjust the padding around the icon within the button (shown as percentage)
  • Opacity: Set the transparency level of the button (0-100%)
  • Size: Choose between normal or mini (small) size variants
  • Show on Lock Screen: When enabled, the button will be visible on the lock screen (not available on Android 8.0 and above)
  • Prevent Removal by Dragging to Bin: When enabled, the button cannot be removed by dragging it to the trash icon
  • Disable Macro/Trigger on Remove: When the button is dragged to the trash icon, choose whether to disable the entire macro or just the trigger
  • Vibrate on Press: Enable haptic feedback when the button is pressed
  • Force Location When Enabled: Specify exact X and Y coordinates for the button position when the macro is enabled
    • Coordinates can be specified in pixels or as a percentage of screen size
    • Supports magic text and variables for dynamic positioning
  • Fixed Location: Prevents the button from being dragged to a new position

Examples

Example 1: Quick Screenshot Button

Triggers

Floating Button (screenshot_btn)
Actions

Take Screenshot

This creates a floating button that takes a screenshot when pressed. The identifier "screenshot_btn" allows other macros to control this button.

Example 2: Toggle Flashlight

Triggers

Floating Button (flashlight)
Actions

Torch Toggle

A floating button that toggles the device's flashlight/torch on and off.

Notes

  • This trigger requires the "Draw over other apps" (overlay) permission.
  • The button remembers its last position when hidden, unless "Force Location When Enabled" is configured.
  • Multiple floating buttons can exist simultaneously if they have different identifiers.
  • Use the Floating Button Configure action to dynamically modify button appearance and position.
  • Icons can be selected from app icons, user-uploaded images, MacroDroid's built-in icons, or Material Design icons.
  • Text icons support magic text, allowing dynamic text based on variables or system values.

See Also