Version 3.0.352

This commit is contained in:
Anja 2022-11-25 09:55:23 +01:00
parent 40b96f0350
commit 5ea2e3b0ca
48 changed files with 601 additions and 255 deletions

View file

@ -642,6 +642,16 @@ namespace TINK.Model
AppResources.ChangeLog_3_0_350_SB_MK,
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
},
{
new Version(3, 0, 351),
AppResources.ChangeLog_MinorBugFixes,
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
},
{
new Version(3, 0, 352),
AppResources.ChangeLog_MinorDesignImprovements,
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
},
};
/// <summary> Manges the whats new information.</summary>

View file

@ -259,7 +259,7 @@ namespace TINK.MultilingualResources {
}
/// <summary>
/// Looks up a localized string similar to Closing lock....
/// Looks up a localized string similar to &lt;h4&gt;&lt;b&gt;Lock is closing.&lt;br/&gt;Please visually check if it is completely closed.&lt;/b&gt;&lt;/h4&gt;.
/// </summary>
public static string ActivityTextClosingLock {
get {
@ -484,7 +484,7 @@ namespace TINK.MultilingualResources {
}
/// <summary>
/// Looks up a localized string similar to Opening lock....
/// Looks up a localized string similar to &lt;h4&gt;&lt;b&gt;Lock is opening.&lt;br/&gt;Please wait until it is completely open.&lt;/b&gt;&lt;/h4&gt;.
/// </summary>
public static string ActivityTextOpeningLock {
get {

View file

@ -334,7 +334,7 @@ Freigabedialog öffen?</value>
<value>Einen Moment bitte...</value>
</data>
<data name="ActivityTextOpeningLock" xml:space="preserve">
<value>Öffne Schloss...</value>
<value>&lt;h4&gt;&lt;b&gt;Schloss öffnet.&lt;br/&gt;Bitte warten Sie, bis es komplett geöffnet ist.&lt;/b&gt;&lt;/h4&gt;</value>
</data>
<data name="ActivityTextStartingUpdater" xml:space="preserve">
<value>Starte Aktualisierung...</value>
@ -355,7 +355,7 @@ Freigabedialog öffen?</value>
<value>Kein Netz beim Aktualisieren des Schlossstatusses.</value>
</data>
<data name="ActivityTextClosingLock" xml:space="preserve">
<value>Schließe Schloss...</value>
<value>&lt;h4&gt;&lt;b&gt;Schloss schließt.&lt;br/&gt;Bitte überprüfen Sie visuell, ob es komplett geschlossen ist.&lt;/b&gt;&lt;/h4&gt;</value>
</data>
<data name="ChangeLog3_0_203" xml:space="preserve">
<value>Aktualisierrt auf aktuelle Schloss-Firmware.</value>

View file

@ -439,7 +439,7 @@ Open sharing dialog?</value>
<value>One moment please...</value>
</data>
<data name="ActivityTextOpeningLock" xml:space="preserve">
<value>Opening lock...</value>
<value>&lt;h4&gt;&lt;b&gt;Lock is opening.&lt;br/&gt;Please wait until it is completely open.&lt;/b&gt;&lt;/h4&gt;</value>
</data>
<data name="ActivityTextStartingUpdater" xml:space="preserve">
<value>Updating...</value>
@ -460,7 +460,7 @@ Open sharing dialog?</value>
<value>No web error on updating locking status.</value>
</data>
<data name="ActivityTextClosingLock" xml:space="preserve">
<value>Closing lock...</value>
<value>&lt;h4&gt;&lt;b&gt;Lock is closing.&lt;br/&gt;Please visually check if it is completely closed.&lt;/b&gt;&lt;/h4&gt;</value>
</data>
<data name="ChangeLog3_0_203" xml:space="preserve">
<value>Updated to latest lock firmware.</value>
@ -1188,4 +1188,4 @@ When logging in, you can now view the password you entered. &lt;br/&gt;
&lt;br/&gt;
Try it out!</value>
</data>
</root>
</root>

View file

@ -441,8 +441,8 @@ Freigabedialog öffen?</target>
<target state="translated">Einen Moment bitte...</target>
</trans-unit>
<trans-unit id="ActivityTextOpeningLock" translate="yes" xml:space="preserve">
<source>Opening lock...</source>
<target state="translated">Öffne Schloss...</target>
<source><bpt id="1">&lt;h4&gt;</bpt><bpt id="2">&lt;b&gt;</bpt>Lock is opening.&lt;br/&gt;Please wait until it is completely open.<ept id="2">&lt;/b&gt;</ept><ept id="1">&lt;/h4&gt;</ept></source>
<target state="translated"><bpt id="1">&lt;h4&gt;</bpt><bpt id="2">&lt;b&gt;</bpt>Schloss öffnet.&lt;br/&gt;Bitte warten Sie, bis es komplett geöffnet ist.<ept id="2">&lt;/b&gt;</ept><ept id="1">&lt;/h4&gt;</ept></target>
</trans-unit>
<trans-unit id="ActivityTextStartingUpdater" translate="yes" xml:space="preserve">
<source>Updating...</source>
@ -469,8 +469,8 @@ Freigabedialog öffen?</target>
<target state="translated">Kein Netz beim Aktualisieren des Schlossstatusses.</target>
</trans-unit>
<trans-unit id="ActivityTextClosingLock" translate="yes" xml:space="preserve">
<source>Closing lock...</source>
<target state="translated">Schließe Schloss...</target>
<source><bpt id="1">&lt;h4&gt;</bpt><bpt id="2">&lt;b&gt;</bpt>Lock is closing.&lt;br/&gt;Please visually check if it is completely closed.<ept id="2">&lt;/b&gt;</ept><ept id="1">&lt;/h4&gt;</ept></source>
<target state="translated"><bpt id="1">&lt;h4&gt;</bpt><bpt id="2">&lt;b&gt;</bpt>Schloss schließt.&lt;br/&gt;Bitte überprüfen Sie visuell, ob es komplett geschlossen ist.<ept id="2">&lt;/b&gt;</ept><ept id="1">&lt;/h4&gt;</ept></target>
</trans-unit>
<trans-unit id="ChangeLog3_0_203" translate="yes" xml:space="preserve">
<source>Updated to latest lock firmware.</source>

View file

@ -478,16 +478,16 @@ namespace TINK.ViewModel.Map
{
if (Pins.Count > 0 && Pins.Count != stations.Count)
{
// Either
// - user logged in/ logged out which might lead to more/ less stations beeing available
// - new stations were added/ existing ones remove
Pins.Clear();
// Either
// - user logged in/ logged out which might lead to more/ less stations beeing available
// - new stations were added/ existing ones remove
Pins.Clear();
}
// Check if there are alreay any pins to the map
// i.e detecte first call of member OnAppearing after construction
if (Pins.Count <= 0)
{
{
Log.ForContext<MapPageViewModel>().Debug($"{(ActiveFilterMap.GetGroup().Any() ? $"Active map filter is {string.Join(",", ActiveFilterMap.GetGroup())}." : "Map filter is off.")}");
// Map was not yet initialized.
@ -598,7 +598,7 @@ namespace TINK.ViewModel.Map
{
// Start task which periodically updates pins.
return new PollingUpdateTaskManager(
() =>
async () =>
{
try
{
@ -893,26 +893,148 @@ namespace TINK.ViewModel.Map
/// <summary> User request to center to currentLocation. </summary>
public async Task CenterToCurrentLocation()
{
Location currentLocation = null;
try
{
currentLocation = await GeolocationService.GetAsync();
}
catch (Exception ex)
{
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
}
IsMapPageEnabled = false;
if (currentLocation != null)
{
TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.ActiveMapSpan.Radius);
Log.ForContext<MapPageViewModel>().Information($"Request to center to current position.");
// Stop polling.
//ActionText = AppResources.ActivityTextOneMomentPlease;
await m_oViewUpdateManager.StopUpdatePeridically();
// Clear error info.
Exception = null;
ActiveFilterMap = tinkKonradToggleViewModel.FilterDictionary;
TinkApp.GroupFilterMapPage = ActiveFilterMap;
TinkApp.Save();
}
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
TinkApp.UpdateConnector();
// Check location permission
//ActionText = AppResources.ActivityTextRequestingLocationPermissions;
var status = await PermissionsService.CheckStatusAsync();
if (!GeolocationService.IsSimulation
&& status != Status.Granted)
{
status = await PermissionsService.RequestAsync();
if (status != Status.Granted)
{
var dialogResult = await ViewService.DisplayAlert(
AppResources.MessageTitleHint,
AppResources.MessageCenterMapLocationPermissionOpenDialog,
AppResources.MessageAnswerYes,
AppResources.MessageAnswerNo);
if (dialogResult)
{
// User decided to give access to locations permissions.
PermissionsService.OpenAppSettings();
ActionText = "";
IsRunning = false;
IsMapPageEnabled = true;
return;
}
}
// Do not use property .State to get bluetooth state due
// to issue https://hausource.visualstudio.com/TINK/_workitems/edit/116 /
// see https://github.com/xabre/xamarin-bluetooth-le/issues/112#issuecomment-380994887
if (await BluetoothService.GetBluetoothState() != Plugin.BLE.Abstractions.Contracts.BluetoothState.On)
{
await ViewService.DisplayAlert(
AppResources.MessageTitleHint,
AppResources.MessageBikesManagementBluetoothActivation,
AppResources.MessageAnswerOk);
ActionText = "";
IsRunning = false;
IsMapPageEnabled = true;
return;
}
}
// Move and scale before getting stations and bikes which takes some time.
Location currentLocation = null;
try
{
currentLocation = await GeolocationService.GetAsync();
}
catch (Exception ex)
{
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
}
if (currentLocation != null)
{
IsRunning = true;
ActionText = AppResources.ActivityTextCenterMap;
TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.ActiveMapSpan.Radius);
TinkApp.Save();
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
//Pins.Clear();
//// Update stations
//ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes;
//IsConnected = TinkApp.GetIsConnected();
//var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync();
//// Set pins to their positions on map.
//InitializePins(resultStationsAndBikes.Response.StationsAll);
//Log.ForContext<MapPageViewModel>().Verbose("Update of pins done...");
//// Update pin colors.
//Log.ForContext<MapPageViewModel>().Verbose("Starting update pins color...");
//var l_oColors = GetStationColors(
// Pins.Select(x => x.Tag.ToString()).ToList(),
// resultStationsAndBikes.Response.Bikes);
//// Update pins color form count of bikes located at station.
//UpdatePinsColor(l_oColors);
//Log.ForContext<MapPageViewModel>().Verbose("Update pins color done.");
try
{
// Update bikes at station or my bikes depending on context.
await m_oViewUpdateManager.StartUpdateAyncPeridically(Polling);
}
catch (Exception)
{
// Excpetions are handled insde update task;
}
}
else
{
ActionText = AppResources.ActivityTextErrorQueryLocationWhenAny;
}
IsRunning = false;
IsMapPageEnabled = true;
Log.ForContext<MapPageViewModel>().Information($"Center to current Position done.");
ActionText = "";
}
catch (Exception l_oException)
{
Log.ForContext<MapPageViewModel>().Error("An error occurred while centering to current position.");
ActionText = "";
IsRunning = false;
await ViewService.DisplayAlert(
"Fehler",
AppResources.MessageMapPageErrorSwitch,
String.Format(AppResources.MessageMapPageErrorSwitch, l_oException.Message),
AppResources.MessageAnswerOk);
IsMapPageEnabled = true;
}
}
/// <summary> Command object to bind login button to view model.</summary>
@ -980,7 +1102,7 @@ namespace TINK.ViewModel.Map
Pins.Clear();
// Check location permission
ActionText = AppResources.ActivityTextRequestingLocationPermissions;
//ActionText = AppResources.ActivityTextRequestingLocationPermissions;
var status = await PermissionsService.CheckStatusAsync();
if (TinkApp.CenterMapToCurrentLocation
@ -1024,10 +1146,10 @@ namespace TINK.ViewModel.Map
}
// Move and scale before getting stations and bikes which takes some time.
ActionText = AppResources.ActivityTextCenterMap;
if (TinkApp.CenterMapToCurrentLocation)
{
//ActionText = AppResources.ActivityTextCenterMap;
Location currentLocation = null;
try
{
@ -1045,12 +1167,12 @@ namespace TINK.ViewModel.Map
TinkApp.ActiveMapSpan.Radius);
TinkApp.Save();
//MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
}
}
// Update stations
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes;
IsConnected = TinkApp.GetIsConnected();
var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync();