java.lang.Object | |
↳ | com.vidinoti.android.vdarsdk.arcore.helpers.DisplayRotationHelper |
Helper to track the display rotations. In particular, the 180 degree rotations are not notified by the onSurfaceChanged() callback, and thus they require listening to the android display events. See https://github.com/google-ar/arcore-android-sdk/blob/master/samples/hello_ar_java/app/src/main/java/com/google/ar/core/examples/java/common/helpers/DisplayRotationHelper.java
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs the DisplayRotationHelper but does not register the listener yet.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the aspect ratio of the GL surface viewport while accounting for the display rotation
relative to the device camera sensor orientation.
| |||||||||||
Returns the rotation of the back-facing camera with respect to the display.
| |||||||||||
Unregisters the display listener.
| |||||||||||
Registers the display listener.
| |||||||||||
Records a change in surface dimensions.
| |||||||||||
Updates the session display geometry if a change was posted either by
onSurfaceChanged(int, int) call or by onDisplayChanged(int) system callback. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.hardware.display.DisplayManager.DisplayListener
|
Constructs the DisplayRotationHelper but does not register the listener yet.
context | the Android Context .
|
---|
Returns the aspect ratio of the GL surface viewport while accounting for the display rotation relative to the device camera sensor orientation.
Returns the rotation of the back-facing camera with respect to the display. The value is one of 0, 90, 180, 270.
Unregisters the display listener. Should be called from onPause()
.
Registers the display listener. Should be called from onResume()
.
Records a change in surface dimensions. This will be later used by updateSessionIfNeeded(Session)
. Should be called from android.opengl.GLSurfaceView.Renderer
#onSurfaceChanged(javax.microedition.khronos.opengles.GL10, int, int).
width | the updated width of the surface. |
---|---|
height | the updated height of the surface. |
Updates the session display geometry if a change was posted either by onSurfaceChanged(int, int)
call or by onDisplayChanged(int)
system callback. This
function should be called explicitly before each call to Session#update(). This
function will also clear the 'pending update' (viewportChanged) flag.
session | the Session object to update if display geometry changed. |
---|