Difference between revisions of "Trigger: Floating Button"

m
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<pre style="background-color: #EEEEEE; color: Black; border-radius: 10px; padding: 10px;">
+
<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>
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.
+
''' Options '''
  
If the button is dragged over the trash can icon, the macro will be deactivated (set by default).
+
* '''Identifier''': A unique ID for referencing the button in actions, enabling control across multiple macros. This is displayed in brackets after the trigger name.
  
Supported configurations:
+
* '''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.
  
Identifier:
+
* '''Background Color''': Select a custom background color for the button, or use transparent background
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.
 
  
Icon:
+
* '''Icon Padding''': Adjust the padding around the icon within the button (shown as percentage)
It allows you to use installed application icons, user icons (own images), macrodroid icons, as well as notification and material design.
 
  
Set background:
+
* '''Opacity''': Set the transparency level of the button (0-100%)
Use a background color below the icon.
 
  
Transparent background (checkbox):
+
* '''Size''': Choose between normal or mini (small) size variants
Show the floating button without a background color.
 
  
Padding:
+
* '''Show on Lock Screen''': When enabled, the button will be visible on the lock screen (not available on Android 8.0 and above)
Change a larger or smaller icon padding.
 
  
Opacity:
+
* '''Prevent Removal by Dragging to Bin''': When enabled, the button cannot be removed by dragging it to the trash icon
Change the opacity, higher or lower.
 
  
Normal or Small:
+
* '''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
Toggling between 2 different sizes of floating button.
 
  
Disable macro on remove:
+
* '''Vibrate on Press''': Enable haptic feedback when the button is pressed
This is the default floating button option when you drag the floating button to the trash (it will appear when you start dragging the button) you can also toggle it by just deactivating the trigger (can be re-enabled manually or with the "set floating button action ").
 
  
Force location when enabled:
+
* '''Force Location When Enabled''': Specify exact X and Y coordinates for the button position when the macro is enabled
Whenever this box is checked the floating button appears at the specified coordinates otherwise it will appear at the center of the screen.
+
** Coordinates can be specified in pixels or as a percentage of screen size
</pre>
+
** Supports magic text and variables for dynamic positioning
  
'''Example Usage:'''<br/>
+
* '''Fixed Location''': Prevents the button from being dragged to a new position
When you touch the floating button it will start a voice search, only if the phone is unlocked.
 
<pre style="background-color: #AC2424; color: white; border-radius: 10px; padding: 10px;">
 
Triggers
 
  
Floating button
+
''' Examples '''
</pre><br>
 
<pre style="background-color: #1665B0; color: white; border-radius: 10px; padding: 10px;">
 
Actions
 
  
Voice search
+
''Example 1: Quick Screenshot Button''
</pre><br>
+
  <pre class="trigger-style">Triggers
<pre style="background-color: green; color: white; border-radius: 10px; padding: 10px;">
 
Constrains
 
  
Device unlocked
+
Floating Button (screenshot_btn)</pre>
</pre><br>
+
  <pre class="action-style">Actions
<pre style="background-color: teal; color: white; border-radius: 10px; padding: 10px;">
 
Local variables
 
  
 +
Take Screenshot</pre>
  
</pre><br>
+
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''
 +
  <pre class="trigger-style">Triggers
 +
 
 +
Floating Button (flashlight)</pre>
 +
  <pre class="action-style">Actions
 +
 
 +
Torch Toggle</pre>
 +
 
 +
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 [[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