AspectRatio - Sets aspect ratios in arrangements and detects device orientation changes.

AspectRatio
Sets aspect ratios in arrangements and detects device orientation changes.

GIF_20250907_034032_516

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.

component_method


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.

component_method (2)


IsPortrait

Returns true if the device is in portrait orientation.

component_method (1)


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.

8 Likes