Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
GH-367 Change Ui to UI & Ac to AC (#374)
Browse files Browse the repository at this point in the history
* GH-367 Change Ui to UI

* Ensure proper Ui for Android

* Fix gryoscope

* Rename Ac to AC

* Update framework indexes
  • Loading branch information
jamesmontemagno authored Jul 16, 2018
1 parent 2145fcc commit 3143b4a
Show file tree
Hide file tree
Showing 27 changed files with 47 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Accelerometer/Accelerometer.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Game:
delay = SensorDelay.Game;
break;
case SensorSpeed.Ui:
case SensorSpeed.UI:
delay = SensorDelay.Ui;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions Xamarin.Essentials/Accelerometer/Accelerometer.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static partial class Accelerometer
// https://stackoverflow.com/questions/10044158/android-sensors
internal const double FastestInterval = .02;
internal const double GameInterval = .04;
internal const double UiInterval = .08;
internal const double UIInterval = .08;
internal const double NormalInterval = .225;

internal static bool IsSupported =>
Expand All @@ -29,8 +29,8 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Normal:
manager.AccelerometerUpdateInterval = NormalInterval;
break;
case SensorSpeed.Ui:
manager.AccelerometerUpdateInterval = UiInterval;
case SensorSpeed.UI:
manager.AccelerometerUpdateInterval = UIInterval;
break;
}

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Accelerometer/Accelerometer.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Start(SensorSpeed sensorSpeed)
return;

IsMonitoring = true;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.Ui;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.UI;

try
{
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Battery/Battery.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static BatteryPowerSource PlatformPowerSource
return BatteryPowerSource.Usb;

if (chargePlug == (int)BatteryPlugged.Ac)
return BatteryPowerSource.Ac;
return BatteryPowerSource.AC;

if (chargePlug == (int)BatteryPlugged.Wireless)
return BatteryPowerSource.Wireless;
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Battery/Battery.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static BatteryPowerSource PlatformPowerSource
{
case UIDeviceBatteryState.Full:
case UIDeviceBatteryState.Charging:
return BatteryPowerSource.Ac;
return BatteryPowerSource.AC;
case UIDeviceBatteryState.Unplugged:
return BatteryPowerSource.Battery;
default:
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Battery/Battery.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public enum BatteryPowerSource
{
Unknown,
Battery,
Ac,
AC,
Usb,
Wireless
}
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Battery/Battery.uwp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static BatteryPowerSource PlatformPowerSource
case BatteryState.Full:
case BatteryState.Charging:
case BatteryState.NotPresent:
return BatteryPowerSource.Ac;
return BatteryPowerSource.AC;
case BatteryState.Unknown:
return BatteryPowerSource.Unknown;
default:
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Compass/Compass.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Game:
delay = SensorDelay.Game;
break;
case SensorSpeed.Ui:
case SensorSpeed.UI:
delay = SensorDelay.Ui;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions Xamarin.Essentials/Compass/Compass.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static partial class Compass
internal const double FastestFilter = .01;
internal const double GameFilter = .5;
internal const double NormalFilter = 1;
internal const double UiFilter = 2;
internal const double UIFilter = 2;

public static bool ShouldDisplayHeadingCalibration { get; set; } = false;

Expand All @@ -35,8 +35,8 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
locationManager.HeadingFilter = NormalFilter;
locationManager.DesiredAccuracy = CLLocation.AccuracyBest;
break;
case SensorSpeed.Ui:
locationManager.HeadingFilter = UiFilter;
case SensorSpeed.UI:
locationManager.HeadingFilter = UIFilter;
locationManager.DesiredAccuracy = CLLocation.AccuracyBest;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Compass/Compass.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Start(SensorSpeed sensorSpeed)
return;

IsMonitoring = true;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.Ui;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.UI;

try
{
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/DeviceInfo/DeviceInfo.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static string GetIdiom()
{
var currentIdiom = Idioms.Unsupported;

// first try UiModeManager
// first try UIModeManager
using (var uiModeManager = UiModeManager.FromContext(Essentials.Platform.AppContext))
{
var uiMode = uiModeManager?.CurrentModeType ?? UiMode.TypeUndefined;
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Gyroscope/Gyroscope.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Game:
delay = SensorDelay.Game;
break;
case SensorSpeed.Ui:
case SensorSpeed.UI:
delay = SensorDelay.Ui;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions Xamarin.Essentials/Gyroscope/Gyroscope.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static partial class Gyroscope
// https://stackoverflow.com/questions/10044158/android-sensors
internal const double FastestInterval = .02;
internal const double GameInterval = .04;
internal const double UiInterval = .08;
internal const double UIInterval = .08;
internal const double NormalInterval = .225;

internal static bool IsSupported =>
Expand All @@ -29,8 +29,8 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Normal:
manager.GyroUpdateInterval = NormalInterval;
break;
case SensorSpeed.Ui:
manager.GyroUpdateInterval = UiInterval;
case SensorSpeed.UI:
manager.GyroUpdateInterval = UIInterval;
break;
}

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Gyroscope/Gyroscope.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Start(SensorSpeed sensorSpeed)
return;

IsMonitoring = true;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.Ui;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.UI;

try
{
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Magnetometer/Magnetometer.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Game:
delay = SensorDelay.Game;
break;
case SensorSpeed.Ui:
case SensorSpeed.UI:
delay = SensorDelay.Ui;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions Xamarin.Essentials/Magnetometer/Magnetometer.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static partial class Magnetometer
// https://stackoverflow.com/questions/10044158/android-sensors
internal const double FastestInterval = .02;
internal const double GameInterval = .04;
internal const double UiInterval = .08;
internal const double UIInterval = .08;
internal const double NormalInterval = .225;

internal static bool IsSupported =>
Expand All @@ -29,8 +29,8 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Normal:
manager.MagnetometerUpdateInterval = NormalInterval;
break;
case SensorSpeed.Ui:
manager.MagnetometerUpdateInterval = UiInterval;
case SensorSpeed.UI:
manager.MagnetometerUpdateInterval = UIInterval;
break;
}

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Magnetometer/Magnetometer.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Start(SensorSpeed sensorSpeed)
return;

IsMonitoring = true;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.Ui;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.UI;

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Game:
delay = SensorDelay.Game;
break;
case SensorSpeed.Ui:
case SensorSpeed.UI:
delay = SensorDelay.Ui;
break;
}
Expand Down
6 changes: 3 additions & 3 deletions Xamarin.Essentials/OrientationSensor/OrientationSensor.ios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static partial class OrientationSensor
// https://stackoverflow.com/questions/10044158/android-sensors
internal const double FastestInterval = .02;
internal const double GameInterval = .04;
internal const double UiInterval = .08;
internal const double UIInterval = .08;
internal const double NormalInterval = .225;

internal static bool IsSupported =>
Expand All @@ -29,8 +29,8 @@ internal static void PlatformStart(SensorSpeed sensorSpeed)
case SensorSpeed.Normal:
manager.DeviceMotionUpdateInterval = NormalInterval;
break;
case SensorSpeed.Ui:
manager.DeviceMotionUpdateInterval = UiInterval;
case SensorSpeed.UI:
manager.DeviceMotionUpdateInterval = UIInterval;
break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static void Start(SensorSpeed sensorSpeed)
return;

IsMonitoring = true;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.Ui;
useSyncContext = sensorSpeed == SensorSpeed.Normal || sensorSpeed == SensorSpeed.UI;

try
{
Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Essentials/Types/SensorSpeed.shared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public enum SensorSpeed
{
Fastest,
Game,
Ui,
UI,
Normal,
}
}
4 changes: 2 additions & 2 deletions docs/en/FrameworksIndex/xamarin-essentials-android.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</Type>
<Type Name="Xamarin.Essentials.BatteryChangedEventHandler" Id="T:Xamarin.Essentials.BatteryChangedEventHandler" />
<Type Name="Xamarin.Essentials.BatteryPowerSource" Id="T:Xamarin.Essentials.BatteryPowerSource">
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Ac" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.AC" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Battery" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Unknown" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Usb" />
Expand Down Expand Up @@ -383,7 +383,7 @@
<Member Id="F:Xamarin.Essentials.SensorSpeed.Fastest" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Game" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Normal" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Ui" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.UI" />
</Type>
<Type Name="Xamarin.Essentials.ShareTextRequest" Id="T:Xamarin.Essentials.ShareTextRequest">
<Member Id="M:Xamarin.Essentials.ShareTextRequest.#ctor" />
Expand Down
4 changes: 2 additions & 2 deletions docs/en/FrameworksIndex/xamarin-essentials-ios.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</Type>
<Type Name="Xamarin.Essentials.BatteryChangedEventHandler" Id="T:Xamarin.Essentials.BatteryChangedEventHandler" />
<Type Name="Xamarin.Essentials.BatteryPowerSource" Id="T:Xamarin.Essentials.BatteryPowerSource">
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Ac" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.AC" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Battery" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Unknown" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Usb" />
Expand Down Expand Up @@ -382,7 +382,7 @@
<Member Id="F:Xamarin.Essentials.SensorSpeed.Fastest" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Game" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Normal" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Ui" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.UI" />
</Type>
<Type Name="Xamarin.Essentials.ShareTextRequest" Id="T:Xamarin.Essentials.ShareTextRequest">
<Member Id="M:Xamarin.Essentials.ShareTextRequest.#ctor" />
Expand Down
4 changes: 2 additions & 2 deletions docs/en/FrameworksIndex/xamarin-essentials-uwp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</Type>
<Type Name="Xamarin.Essentials.BatteryChangedEventHandler" Id="T:Xamarin.Essentials.BatteryChangedEventHandler" />
<Type Name="Xamarin.Essentials.BatteryPowerSource" Id="T:Xamarin.Essentials.BatteryPowerSource">
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Ac" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.AC" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Battery" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Unknown" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Usb" />
Expand Down Expand Up @@ -379,7 +379,7 @@
<Member Id="F:Xamarin.Essentials.SensorSpeed.Fastest" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Game" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Normal" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Ui" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.UI" />
</Type>
<Type Name="Xamarin.Essentials.ShareTextRequest" Id="T:Xamarin.Essentials.ShareTextRequest">
<Member Id="M:Xamarin.Essentials.ShareTextRequest.#ctor" />
Expand Down
4 changes: 2 additions & 2 deletions docs/en/FrameworksIndex/xamarin-essentials.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</Type>
<Type Name="Xamarin.Essentials.BatteryChangedEventHandler" Id="T:Xamarin.Essentials.BatteryChangedEventHandler" />
<Type Name="Xamarin.Essentials.BatteryPowerSource" Id="T:Xamarin.Essentials.BatteryPowerSource">
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Ac" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.AC" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Battery" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Unknown" />
<Member Id="F:Xamarin.Essentials.BatteryPowerSource.Usb" />
Expand Down Expand Up @@ -379,7 +379,7 @@
<Member Id="F:Xamarin.Essentials.SensorSpeed.Fastest" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Game" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Normal" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.Ui" />
<Member Id="F:Xamarin.Essentials.SensorSpeed.UI" />
</Type>
<Type Name="Xamarin.Essentials.ShareTextRequest" Id="T:Xamarin.Essentials.ShareTextRequest">
<Member Id="M:Xamarin.Essentials.ShareTextRequest.#ctor" />
Expand Down
8 changes: 4 additions & 4 deletions docs/en/Xamarin.Essentials/BatteryPowerSource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</remarks>
</Docs>
<Members>
<Member MemberName="Ac">
<MemberSignature Language="C#" Value="Ac" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Essentials.BatteryPowerSource Ac = int32(2)" />
<MemberSignature Language="DocId" Value="F:Xamarin.Essentials.BatteryPowerSource.Ac" />
<Member MemberName="AC">
<MemberSignature Language="C#" Value="AC" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Essentials.BatteryPowerSource AC = int32(2)" />
<MemberSignature Language="DocId" Value="F:Xamarin.Essentials.BatteryPowerSource.AC" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
Expand Down
8 changes: 4 additions & 4 deletions docs/en/Xamarin.Essentials/SensorSpeed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
<summary>Default rate suitable for screen orientation changes.</summary>
</Docs>
</Member>
<Member MemberName="Ui">
<MemberSignature Language="C#" Value="Ui" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Essentials.SensorSpeed Ui = int32(2)" />
<MemberSignature Language="DocId" Value="F:Xamarin.Essentials.SensorSpeed.Ui" />
<Member MemberName="UI">
<MemberSignature Language="C#" Value="UI" />
<MemberSignature Language="ILAsm" Value=".field public static literal valuetype Xamarin.Essentials.SensorSpeed UI = int32(2)" />
<MemberSignature Language="DocId" Value="F:Xamarin.Essentials.SensorSpeed.UI" />
<MemberType>Field</MemberType>
<AssemblyInfo>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
Expand Down

0 comments on commit 3143b4a

Please sign in to comment.