Device Orientation Mapper

Defined in namespace Scandit.DataCapture.Core.UI.Orientation

DeviceOrientation

Added in version 6.7.0

This enum represents the rotation state of the current device, taking into consideration its natural orientation. This can be thought of as the orientation in relation to the lower chin of the device when in vertical position. The rotation cycle this creates is the following when clockwise: Portrait -> LandscapeLeft -> Portrait Upside Down -> Landscape Right and the other way around when counter-clockwise.

Notice that the entry point of the cycle may be different depending on the device default orientation: * A device which defaults a rectangular screen’s ui to vertical, will enter the rotation cycle above from the Portrait state. Rotating the device clockwise will change the orientation to LandscapeLeft, rotating it one more time ( if the device allows ) will change the orientation to PortraitUpsideDown and so on. * A device which defaults a rectangular screen’s ui to horizontal, will enter the rotation cycle above from the LandscapeRight state. Rotating the device clockwise will change the orientation to Portrait, rotating it one more time will change the orientation to LandscapeLeft and so on.

Note

The second example may apply also to tablets which have hardware navigation buttons on the long side. This means that when the device is in Portrait those buttons will be on the left side.

Portrait

Added in version 6.7.0

The device is in Portrait orientation.

LandscapeRight

Added in version 6.7.0

The device is in Landscape Right orientation.

PortraitUpsideDown

Added in version 6.7.0

The device is in Upside Down Portrait orientation.

LandscapeLeft

Added in version 6.7.0

The device is in Landscape Left orientation.

DeviceOrientationMapper
class DeviceOrientationMapper

Added in version 6.7.0

A mapper to infer the device orientation from the screen rotation. Particularly useful in combination with IDataCaptureViewListener.OnSizeChanged() to react to orientation changes.

DeviceOrientationMapper()
DeviceOrientationMapper()

Added in version 6.7.0

Constructs a new DeviceOrientationMapper instance.

MapRotationToOrientation()
DeviceOrientation MapRotationToOrientation(int rotation)

Added in version 6.7.0

Maps the screen rotation (for example provided in IDataCaptureViewListener.OnSizeChanged()) to a device orientation.