mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-06-22 05:47:28 +02:00
Version 3.0.290
This commit is contained in:
parent
af3c20ea1c
commit
ad3cdbcadf
231 changed files with 14555 additions and 7798 deletions
|
@ -0,0 +1,13 @@
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
public class GeolocationAccuracyBestService : GeolocationService
|
||||
{
|
||||
public GeolocationAccuracyBestService(IGeolodationDependent dependent) : base(
|
||||
dependent, GeolocationAccuracy.Best)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
public class GeolocationAccuracyHighService : GeolocationService
|
||||
{
|
||||
public GeolocationAccuracyHighService(IGeolodationDependent dependent) : base(
|
||||
dependent, GeolocationAccuracy.High)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
public class GeolocationAccuracyMediumService : GeolocationService
|
||||
{
|
||||
public GeolocationAccuracyMediumService(IGeolodationDependent dependent) : base(
|
||||
dependent, GeolocationAccuracy.Medium)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -5,18 +5,23 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Model.Services.Geolocation
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
public class GeolocationService : IGeolocation
|
||||
public abstract class GeolocationService : IGeolocation
|
||||
{
|
||||
/// <summary> Timeout for geolocation request operations.</summary>
|
||||
private const int GEOLOCATIONREQUEST_TIMEOUT_MS = 5000;
|
||||
|
||||
private IGeolodationDependent Dependent { get; }
|
||||
|
||||
public GeolocationService(IGeolodationDependent dependent)
|
||||
private GeolocationAccuracy Accuracy { get; }
|
||||
|
||||
public GeolocationService(
|
||||
IGeolodationDependent dependent,
|
||||
GeolocationAccuracy accuracy = GeolocationAccuracy.Default)
|
||||
{
|
||||
Dependent = dependent;
|
||||
Accuracy = accuracy;
|
||||
}
|
||||
|
||||
public bool IsSimulation => false;
|
||||
|
@ -30,7 +35,7 @@ namespace TINK.Model.Services.Geolocation
|
|||
{
|
||||
try
|
||||
{
|
||||
var request = new GeolocationRequest(GeolocationAccuracy.Medium, TimeSpan.FromMilliseconds(GEOLOCATIONREQUEST_TIMEOUT_MS));
|
||||
var request = new GeolocationRequest(Accuracy, TimeSpan.FromMilliseconds(GEOLOCATIONREQUEST_TIMEOUT_MS));
|
||||
return cancellationToken.HasValue
|
||||
? await Xamarin.Essentials.Geolocation.GetLocationAsync(request, cancellationToken.Value)
|
||||
: await Xamarin.Essentials.Geolocation.GetLocationAsync(request);
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Model.Services.Geolocation
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
/// <summary> Query geolocation. </summary>
|
||||
public interface IGeolocation : IGeolodationDependent
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Model.Services.Geolocation
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
public class LastKnownGeolocationService : IGeolocation
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ namespace TINK.Model.Services.Geolocation
|
|||
return location;
|
||||
}
|
||||
|
||||
return await new GeolocationService(Dependent).GetAsync(cancelationToken, timeStamp);
|
||||
return await new GeolocationAccuracyMediumService(Dependent).GetAsync(cancelationToken, timeStamp);
|
||||
}
|
||||
|
||||
/// <summary> If true location data returned is simulated.</summary>
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Threading.Tasks;
|
|||
using TINK.Model.Device;
|
||||
using Xamarin.Essentials;
|
||||
|
||||
namespace TINK.Model.Services.Geolocation
|
||||
namespace TINK.Services.Geolocation
|
||||
{
|
||||
public class SimulatedGeolocationService : IGeolocation
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue