Changes

no edit summary
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 rotate is when the screen changes from portrait to landscape or landscape to portrait, depending on how the device is held.
     −
This setting can be turned on and off on the device (typically via a quick tile). This trigger will fire when the setting is enabled/disabled depending upon the option chosen.
+
''' 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]]