-
public class OrientationHelperHelps with keeping track of both device orientation (which changes when device is rotated) and the display offset (which depends on the activity orientation wrt the device default orientation).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceOrientationHelper.CallbackReceives callback about the orientation changes.
-
Constructor Summary
Constructors Constructor Description OrientationHelper(Context context, OrientationHelper.Callback callback)Creates a new orientation helper.
-
Method Summary
Modifier and Type Method Description voidenable()Enables this listener. voiddisable()Disables this listener. intgetLastDeviceOrientation()Returns the current device orientation. intgetLastDisplayOffset()Returns the current display offset. -
-
Constructor Detail
-
OrientationHelper
OrientationHelper(Context context, OrientationHelper.Callback callback)
Creates a new orientation helper.- Parameters:
context- a valid contextcallback- a Callback
-
-
Method Detail
-
enable
void enable()
Enables this listener.
-
disable
void disable()
Disables this listener.
-
getLastDeviceOrientation
int getLastDeviceOrientation()
Returns the current device orientation.
-
getLastDisplayOffset
int getLastDisplayOffset()
Returns the current display offset.
-
-
-
-