Window.onDisplayRotate

Function/Meaning

When the screen is rotated

Type
WindowclassEvent
Syntax
onDisplayRotate(orientation, angle, bpp, width, height)
Arguments
orientation

The orientation of the screen. It can be one of the following values: oriUnknown (acquisition failure / unknown), oriPortrait (portrait), oriLandscape (landscape)

angle

The angle. The angle is 0, 90, 180, 270, or -1, and if it cannot be obtained, it will be -1.
The angle is the rotation angle from the device default, so it will be 0 in portrait orientation for portrait devices.
On a normal device, it seems that there are many 0s in landscape orientation.
The portrait orientation is 0 for recent 8-inch tablets, etc., and the portrait orientation is the standard orientation.
Android always returns -1.
If necessary, get it separately with Windows.displayRotate.

bpp

bits per pixel. On Android, the dpi value is returned.

width

The width of the screen.
Android always returns 0.
Obtain it separately if necessary.

height

The height of the screen.
Android always returns 0.
Obtain it separately if necessary.

Return value
None (void)
Explanation

Represents an event function that is called when the screen is rotated.

Reference
Window.displayOrientation
Window.displayRotate