Difference between revisions of "Trigger: Auto Rotate changed"
| Line 1: | Line 1: | ||
| − | <pre class="header-style> | + | <pre class="header-style">The Auto Rotate Changed trigger fires when the auto rotate (automatic screen rotation) setting on the device changes. This allows you to respond when the user enables or disables automatic screen rotation.</pre> |
| − | Auto | ||
| − | + | ''' Options ''' | |
| − | </pre> | + | |
| + | * '''Enabled''' - Trigger fires when auto rotate is turned on | ||
| + | * '''Disabled''' - Trigger fires when auto rotate is turned off | ||
| + | |||
| + | ''' Examples ''' | ||
| + | |||
| + | ''Example 1: Notify When Auto Rotate Disabled'' | ||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | Auto Rotate Changed (Disabled)</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Toast: Screen rotation locked</pre> | ||
| + | |||
| + | ''Example 2: Set Orientation for Video App'' | ||
| + | <pre class="trigger-style">Triggers | ||
| + | |||
| + | Auto Rotate Changed (Enabled)</pre> | ||
| + | <pre class="action-style">Actions | ||
| + | |||
| + | Set Variable: [auto_rotate_enabled] = true</pre> | ||
| + | |||
| + | ''' Notes ''' | ||
| + | |||
| + | * The trigger monitors the system setting ACCELEROMETER_ROTATION to detect changes | ||
| + | * Only one option can be selected per trigger instance - create separate triggers if you need to respond to both enabling and disabling | ||
| + | * The trigger uses a ContentObserver to efficiently monitor the setting without polling | ||
| + | * The trigger only fires when the state actually changes (not on repeated settings to the same value) | ||
| + | |||
| + | ''' See Also ''' | ||
| + | |||
| + | * [[Action: Auto Rotate On/Off|Auto Rotate On/Off Action]] | ||
| + | * [[Constraint:_Auto_Rotate|Auto Rotate Constraint]] | ||
Latest revision as of 21:31, 5 January 2026
The Auto Rotate Changed trigger fires when the auto rotate (automatic screen rotation) setting on the device changes. This allows you to respond when the user enables or disables automatic screen rotation.
Options
- Enabled - Trigger fires when auto rotate is turned on
- Disabled - Trigger fires when auto rotate is turned off
Examples
Example 1: Notify When Auto Rotate Disabled
Triggers Auto Rotate Changed (Disabled)
Actions Toast: Screen rotation locked
Example 2: Set Orientation for Video App
Triggers Auto Rotate Changed (Enabled)
Actions Set Variable: [auto_rotate_enabled] = true
Notes
- The trigger monitors the system setting ACCELEROMETER_ROTATION to detect changes
- Only one option can be selected per trigger instance - create separate triggers if you need to respond to both enabling and disabling
- The trigger uses a ContentObserver to efficiently monitor the setting without polling
- The trigger only fires when the state actually changes (not on repeated settings to the same value)
See Also