Sets aspect ratios in arrangements and detects device orientation changes.
I made this extension to complement the
Camera extension.
Initialize
Establishes the basic arrangement measures for both orientations.
InitializeOrientationDetection
Set a clock to automatically detect orientation changes.
CheckOrientation
Must be called from a clock's Timer event to check for orientation changes.
AspectRatio
Sets the aspect ratio of the Arrangement.
Type: '1:1'
, '3:4'
, '9:16'
, '16:9'
, '4:3'
, or 'Full'
. Must be called after Initialize.
IsLandscape
Returns true if the device is in landscape orientation.
IsPortrait
Returns true if the device is in portrait orientation.
OrientationCheckInterval
Sets the interval for checking for orientation changes in milliseconds.
EnableOrientationDetection
Enables or disables automatic detection of orientation changes.
OrientationChanged
Triggered when the device orientation changes.
v1.0 Sep 07, 2025.
AspectRatio.aia (25.6 KB)
joejsanz.joedevaspectratio.aix (8.9 KB)
JDK: 11
Minimum API Level: 21
Updated On: 2025-09-07T07:00:00Z
Built using: FAST-CLI v4.3.1-premium
Thanks.