/// <summary>
/// Gets the value of the rotation state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <value> The rotation state. </value>
public AutoRotationState Rotaion { get; private set; } = AutoRotationState.Degree_0;
/// <summary>
/// Gets the accuracy of the auto rotation data.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <value> Accuracy </value>
public SensorDataAccuracy Accuracy { get; private set; }
}
/// <summary>
/// Gets the value of the rotation state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <value> The rotation state. </value>
public AutoRotationState Rotaion { get; private set; } = AutoRotationState.Degree_0;
/// <summary>
/// Gets the accuracy of the auto rotation data.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <value> Accuracy </value>
public SensorDataAccuracy Accuracy { get; private set; } = SensorDataAccuracy.Undefined;
/// <summary>
/// Returns true or false based on whether the auto rotation sensor is supported by the device.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <value><c>true</c> if supported; otherwise <c>false</c>.</value>
public static bool IsSupported
{
/// <summary>
/// Initializes a new instance of the <see cref="Tizen.Sensor.AutoRotationSensor"/> class.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
/// <feature>http://tizen.org/feature/sensor.auto_rotation</feature>
/// <exception cref="ArgumentException">Thrown when an invalid argument is used.</exception>
/// <exception cref="NotSupportedException">Thrown when the sensor is not supported.</exception>
/// <summary>
/// An event handler for storing the callback functions for the event corresponding to the change in the auto rotation sensor data.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
public event EventHandler<AutoRotationSensorDataUpdatedEventArgs> DataUpdated;
/// <summary>
/// An event handler for accuracy changed events.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
public event EventHandler<SensorAccuracyChangedEventArgs> AccuracyChanged
{
add
Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr);
TimeSpan = new TimeSpan((Int64)sensorData.timestamp);
- Rotaion = (AutoRotationState)sensorData.values[0];
+ if (sensorData.values[0] == 0) {
+ Rotaion = AutoRotationState.Degree_0;
+ } else {
+ Rotaion = (AutoRotationState)sensorData.values[0];
+ }
Accuracy = sensorData.accuracy;
DataUpdated?.Invoke(this, new AutoRotationSensorDataUpdatedEventArgs(sensorData.values, sensorData.accuracy));
/// <summary>
/// The auto rotation state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
[EditorBrowsable(EditorBrowsableState.Never)]
public enum AutoRotationState
{
/// <summary>
/// Degree_0 sate.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- Degree_0 = 0,
+ Degree_0 = 1,
/// <summary>
/// Degree_90 state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- Degree_90 = 1,
+ Degree_90 = 2,
/// <summary>
/// Degree_180 state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- Degree_180 = 2,
+ Degree_180 = 3,
/// <summary>
/// Degree_270 state.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- Degree_270 = 3
+ Degree_270 = 4
}
}