Version 3.0.262

This commit is contained in:
ohauff 2021-11-21 12:34:25 +01:00
parent 3fed2707cd
commit b6bee60e60
42 changed files with 4633 additions and 1030 deletions

View file

@ -151,7 +151,6 @@ namespace TINK
DependencyService.Get<ISmartDevice>(),
specialFolders,
new Cipher(),
null, // Permissions, no more used.
#if ARENDI
DependencyService.Get<ICentral>(),
#else
@ -283,7 +282,7 @@ namespace TINK
if (_PermissionsService != null)
return _PermissionsService;
_PermissionsService = new Services.Permissions.Plugin.Permissions();
_PermissionsService = new Services.Permissions.Essentials.Permissions();
return _PermissionsService;
}
}

View file

@ -33,7 +33,6 @@
<tr><td>PCLStorage von Daniel Plaisted </td><td><a href="#MSPL_Long">Microsoft Public License (Ms-PL)</a> </td></tr>
<tr><td>Pinvoke von AArnott </td><td><a href="#MITLicenseAArnott">MIT- Lizenz für Pinvoke</a> </td></tr>
<tr><td>Plugin.BLE Adrian Seceleanu, Sven-Michael Stübe </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
<tr><td>Plugin.Permissions von James Montemagno </td><td><a href="#MITLicenseMontemagno2016">MIT Lizenz 2016</a> </td></tr>
<tr><td>Polly von Michael Wolfenden, App vNext </td><td><a href="#NewBSDLicense">New BSD License</a> </td></tr>
<tr><td>Serilog von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>
<tr><td>Serilog.Sinks.Debug von Serilog Contributors </td><td><a href="#ApacheLicense2.0_2004">Apache License 2.0</a> </td></tr>

View file

@ -21,6 +21,9 @@ namespace TINK.View.Map
/// <summary> View model to notify about whether page appears or hides. </summary>
private MapPageViewModel MapPageViewModel { get; set; }
/// <summary> Initialization status to ensure initialization logic is not called multiple times. </summary>
private bool isInitializationStarted = false;
/// <summary>
/// Constructs map page instance.
/// </summary>
@ -125,30 +128,27 @@ namespace TINK.View.Map
public INavigationMasterDetail NavigationMasterDetail { private get; set; }
#endif
/// <summary>
/// Invoked when page is shown.
/// Invoked when page is shown.
/// Starts update process.
/// </summary>
protected async override void OnAppearing()
{
// Don't repeat the initialization if it has been completed already.
if (isInitializationStarted) return;
isInitializationStarted = true;
// Pass reference to member Navigation to show bikes at station x dialog.
try
{
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
#if TRYNOTBACKSTYLE
MapPageViewModel = new MapPageViewModel();
#else
MapPageViewModel = new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
MapPageViewModel = CreateMapPageViewModel();
#endif
} catch (Exception exception)
}
catch (Exception exception)
{
Log.ForContext<MapPage>().Error("Constructing map page view model failed. {Exception}", exception);
@ -171,15 +171,7 @@ namespace TINK.View.Map
try
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
ApplyCustomiOSStyling();
}
catch (Exception exception)
{
@ -201,10 +193,7 @@ namespace TINK.View.Map
try
{
// Pre move and scanle maps to avoid initial display of map in Rome.
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
PremoveAndScaleMap();
}
catch(Exception exception)
{
@ -224,8 +213,54 @@ namespace TINK.View.Map
}
}
/// <summary>
/// Invoked when pages is closed/ hidden.
/// Premoves the Map to a certain location.
/// </summary>
private void PremoveAndScaleMap()
{
Log.ForContext<MapPage>().Verbose("Moving and scaling map.");
MapPageViewModel.MoveAndScale(
(mapSpan) => MyMap.MoveToRegion(mapSpan),
App.ModelRoot.MapSpan);
}
/// <summary>
/// Creates the Map Page's view model.
/// </summary>
private MapPageViewModel CreateMapPageViewModel()
{
Log.ForContext<MapPage>().Verbose("Constructing map page view model.");
return new MapPageViewModel(
App.ModelRoot,
App.PermissionsService,
App.BluetoothService,
App.GeolocationServicesContainer.Active,
(mapspan) => MyMap.MoveToRegion(mapspan),
this,
Navigation);
}
/// <summary>
/// Applies iOS specific styling to branded Buttons.
/// </summary>
private void ApplyCustomiOSStyling()
{
if (Device.RuntimePlatform == Device.iOS)
{
TINKButton.BackgroundColor = Color.LightGray;
TINKButton.BorderColor = Color.Black;
TINKButton.Margin = new Thickness(10, 10, 10, 10);
KonradButton.BackgroundColor = Color.LightGray;
KonradButton.BorderColor = Color.Black;
KonradButton.Margin = new Thickness(10, 10, 10, 10);
}
}
/// <summary>
/// Invoked when pages is closed/ hidden.
/// Stops update process.
/// </summary>
protected override async void OnDisappearing()
@ -235,8 +270,7 @@ namespace TINK.View.Map
// View model might be null.
await MapPageViewModel?.OnDisappearing();
}
base.OnDisappearing();
}
}
}
}