public class OrientationSensor
extends android.view.OrientationEventListener
Modifier and Type | Class and Description |
---|---|
static interface |
OrientationSensor.OrientationListener |
static class |
OrientationSensor.SCREEN_ROTATION_MODE |
static class |
OrientationSensor.ScreenOrientation |
Constructor and Description |
---|
OrientationSensor(android.content.Context context,
int rate) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(OrientationSensor.OrientationListener listener) |
void |
clearListener() |
static int |
getDeviceDefaultOrientation() |
static OrientationSensor |
getInstance() |
static OrientationSensor.ScreenOrientation |
getScreenOrientation() |
static void |
initSensor(android.content.Context context) |
static boolean |
isScreenPortrait() |
void |
onOrientationChanged(int angle) |
void |
removeListener(OrientationSensor.OrientationListener listener) |
void |
start(OrientationSensor.SCREEN_ROTATION_MODE mode) |
void |
stop() |
public OrientationSensor(android.content.Context context, int rate)
public void addListener(OrientationSensor.OrientationListener listener)
public void clearListener()
public static int getDeviceDefaultOrientation()
public static OrientationSensor getInstance()
public static OrientationSensor.ScreenOrientation getScreenOrientation()
public static void initSensor(android.content.Context context)
public static boolean isScreenPortrait()
public void onOrientationChanged(int angle)
onOrientationChanged
in class android.view.OrientationEventListener
public void removeListener(OrientationSensor.OrientationListener listener)
public void start(OrientationSensor.SCREEN_ROTATION_MODE mode)
public void stop()