OrientationListener
abstract classOrientationListener: SensorListener
kotlin.Any | |
↳ | android.view.OrientationListener |
Helper class for receiving notifications from the SensorManager when the orientation of the device has changed.
Summary
Constants | |
---|---|
static Int |
Returned from onOrientationChanged when the device orientation cannot be determined (typically when the device is in a close to flat position). |
Public constructors | |
---|---|
OrientationListener(context: Context!) Creates a new OrientationListener. |
|
OrientationListener(context: Context!, rate: Int) Creates a new OrientationListener. |
Public methods | |
---|---|
open Unit |
disable() Disables the OrientationListener. |
open Unit |
enable() Enables the OrientationListener so it will monitor the sensor and call |
open Unit |
onAccuracyChanged(sensor: Int, accuracy: Int) |
abstract Unit |
onOrientationChanged(orientation: Int) Look at |
open Unit |
onSensorChanged(sensor: Int, values: FloatArray!) |
Constants
ORIENTATION_UNKNOWN
static valORIENTATION_UNKNOWN: Int
Deprecated: Deprecated in Java.
Returned from onOrientationChanged when the device orientation cannot be determined (typically when the device is in a close to flat position).
Value: -1
See Also
Public constructors
OrientationListener
OrientationListener(context: Context!)
Creates a new OrientationListener.
Parameters | |
---|---|
context |
Context!: for the OrientationListener. |
OrientationListener
OrientationListener(
context: Context!,
rate: Int)
Creates a new OrientationListener.
Parameters | |
---|---|
context |
Context!: for the OrientationListener. |
rate |
Int: at which sensor events are processed (see also SensorManager ). Use the default value of SENSOR_DELAY_NORMAL for simple screen orientation change detection. |
Public methods
disable
open fundisable(): Unit
Deprecated: Deprecated in Java.
Disables the OrientationListener.
enable
open funenable(): Unit
Deprecated: Deprecated in Java.
Enables the OrientationListener so it will monitor the sensor and call onOrientationChanged
when the device orientation changes.
onAccuracyChanged
open funonAccuracyChanged(
sensor: Int,
accuracy: Int
): Unit
Deprecated: Deprecated in Java.
Parameters | |
---|---|
sensor |
Int: The ID of the sensor being monitored |
accuracy |
Int: The new accuracy of this sensor. |
onOrientationChanged
abstract funonOrientationChanged(orientation: Int): Unit
Deprecated: Deprecated in Java.
Look at android.view.OrientationEventListener#onOrientationChanged
for method description and usage
Parameters | |
---|---|
orientation |
Int: The new orientation of the device. |
See Also
onSensorChanged
open funonSensorChanged(
sensor: Int,
values: FloatArray!
): Unit
Deprecated: Deprecated in Java.
Parameters | |
---|---|
sensor |
Int: The ID of the sensor being monitored |
values |
FloatArray!: The new values for the sensor. |