public abstract class WindowOrientationListener extends Object
Constructor and Description |
---|
WindowOrientationListener(Context context,
Handler handler)
Creates a new WindowOrientationListener.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canDetectOrientation()
Returns true if sensor is enabled and false otherwise
|
void |
disable()
Disables the WindowOrientationListener.
|
void |
dump(PrintWriter pw,
String prefix) |
void |
enable()
Enables the WindowOrientationListener so it will monitor the sensor and call
onProposedRotationChanged(int) when the device orientation changes. |
int |
getProposedRotation()
Gets the proposed rotation.
|
abstract void |
onProposedRotationChanged(int rotation)
Called when the rotation view of the device has changed.
|
void |
onTouchEnd() |
void |
onTouchStart() |
void |
setCurrentRotation(int rotation)
Sets the current rotation.
|
public void enable()
onProposedRotationChanged(int)
when the device orientation changes.public void disable()
public void onTouchStart()
public void onTouchEnd()
public void setCurrentRotation(int rotation)
rotation
- The current rotation.public int getProposedRotation()
public boolean canDetectOrientation()
public abstract void onProposedRotationChanged(int rotation)
rotation
- The new orientation of the device, one of the Surface.ROTATION_* constants.Surface
public void dump(PrintWriter pw, String prefix)