Skip to content

Commit

Permalink
feat: Add HeadingTrueNorth support for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev authored and ahmed605 committed Sep 13, 2023
1 parent 5850eeb commit b96e7e8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<Run FontWeight="Bold">HeadingMagneticNorth:</Run>
<Run Text="{Binding HeadingMagneticNorth}" />
</TextBlock>
<TextBlock>
<Run FontWeight="Bold">HeadingTrueNorth:</Run>
<Run Text="{Binding HeadingTrueNorth}" />
</TextBlock>
<TextBlock>
<Run FontWeight="Bold">Timestamp: </Run>
<Run Text="{Binding Timestamp}" />
Expand Down
11 changes: 11 additions & 0 deletions src/SamplesApp/UITests.Shared/Windows_Devices/CompassTests.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal class CompassTestsViewModel : ViewModelBase
private bool _readingChangedAttached;
private string _sensorStatus;
private double _headingMagneticNorth;
private double _headingTrueNorth;
private string _timestamp;

public CompassTestsViewModel(CoreDispatcher dispatcher) : base(dispatcher)
Expand Down Expand Up @@ -109,6 +110,16 @@ private set
}
}

public double HeadingTrueNorth
{
get => _headingTrueNorth;
private set
{
_headingTrueNorth = value;
RaisePropertyChanged();
}
}

public string Timestamp
{
get => _timestamp;
Expand Down
3 changes: 3 additions & 0 deletions src/Uno.UWP/Devices/Sensors/CompassReading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ public partial class CompassReading
{
internal CompassReading(
double headingMagneticNorth,
double headingTrueNorth,
DateTimeOffset timestamp)
{
HeadingMagneticNorth = headingMagneticNorth;
HeadingTrueNorth = headingTrueNorth;
Timestamp = timestamp;
}


public double HeadingMagneticNorth { get; }
public double HeadingTrueNorth { get; }

public DateTimeOffset Timestamp { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public double HeadingMagneticNorth
}
}
#endif
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public double? HeadingTrueNorth
{
Expand Down

0 comments on commit b96e7e8

Please sign in to comment.