Gyro


Adjusts some attributes of the parent group- or part-based element according to arithmetic expressions that includes gyroscopic sensor data sources, such as ACCELEROMETER_ANGLE_X.

Introduced in Wear OS 4.

Syntax

<Gyro x="arithmetic-expression" y="arithmetic-expression"
      scaleX="arithmetic-expression" scaleY="arithmetic-expression"
      angle="arithmetic-expression" alpha="arithmetic-expression">
</Gyro>

Attributes

The Gyro element has the following optional attributes:

x, y
A pair of arithmetic expressions that, when evaluated, specify the amount of horizontal or vertical movement that the gyroscopic effect applies to the parent element.
scaleX, scaleY
A pair of arithmetic expressions that, when evaluated, specify the amount of horizontal or vertical size scaling that the gyroscopic effect applies to the parent element.
angle
An arithmetic expression that, when evaluated, indicates a number of degrees, clockwise, that the element should be rotated about its pivot point based on gyroscopic sensors.
alpha
An arithmetic expression that, when evaluated, indicates the level of transparency that this element should have based on gyroscopic sensors. A value of 0 indicates that the element should be completely transparent. A value of 255 indicates that the element should be completely opaque.