mirror of
https://dev.azure.com/TeilRad/sharee.bike%20App/_git/Code
synced 2025-04-22 12:56:29 +02:00
Version 3.0.354
This commit is contained in:
parent
85321580df
commit
8b460bfebf
51 changed files with 363 additions and 570 deletions
|
@ -657,6 +657,11 @@ namespace TINK.Model
|
|||
AppResources.ChangeLog_3_0_353_MK_SB,
|
||||
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
||||
},
|
||||
{
|
||||
new Version(3, 0, 354),
|
||||
AppResources.ChangeLog_PackageUpdates,
|
||||
new List<AppFlavor> { AppFlavor.MeinKonrad, AppFlavor.ShareeBike }
|
||||
},
|
||||
};
|
||||
|
||||
/// <summary> Manges the whats new information.</summary>
|
||||
|
|
|
@ -756,6 +756,15 @@ namespace TINK.MultilingualResources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Software packages were updated..
|
||||
/// </summary>
|
||||
public static string ChangeLog_PackageUpdates {
|
||||
get {
|
||||
return ResourceManager.GetString("ChangeLog_PackageUpdates", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Updated to latest lock firmware..
|
||||
/// </summary>
|
||||
|
|
|
@ -1108,4 +1108,7 @@ Probieren Sie es aus!</value>
|
|||
<li/>- Design von Prozessen
|
||||
</ul></value>
|
||||
</data>
|
||||
<data name="ChangeLog_PackageUpdates" xml:space="preserve">
|
||||
<value>Softwarepakete wurden aktualisiert.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1198,4 +1198,7 @@ Try it out!</value>
|
|||
<li/>- Design of processes
|
||||
</ul></value>
|
||||
</data>
|
||||
</root>
|
||||
<data name="ChangeLog_PackageUpdates" xml:space="preserve">
|
||||
<value>Software packages were updated.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -1516,6 +1516,10 @@ Probieren Sie es aus!</target>
|
|||
<li/>- Design von Prozessen
|
||||
<ept id="1"></ul></ept></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ChangeLog_PackageUpdates" translate="yes" xml:space="preserve">
|
||||
<source>Software packages were updated.</source>
|
||||
<target state="translated">Softwarepakete wurden aktualisiert.</target>
|
||||
</trans-unit>
|
||||
</group>
|
||||
</body>
|
||||
</file>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="MonkeyCache" Version="1.6.3" />
|
||||
<PackageReference Include="MonkeyCache.FileStore" Version="1.6.3" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
|
||||
<PackageReference Include="Plugin.BLE" Version="2.1.3" />
|
||||
<PackageReference Include="Plugin.BluetoothLE" Version="6.3.0.19" />
|
||||
<PackageReference Include="Plugin.Permissions" Version="6.0.1" />
|
||||
|
@ -44,8 +44,8 @@
|
|||
<PackageReference Include="System.Xml.XDocument" Version="4.3.0" />
|
||||
<PackageReference Include="Xam.Plugin.Connectivity" Version="3.2.0" />
|
||||
<PackageReference Include="Xam.Plugins.Messaging" Version="5.2.0" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.3" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2515" />
|
||||
<PackageReference Include="Xamarin.Essentials" Version="1.7.4" />
|
||||
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2545" />
|
||||
<PackageReference Include="Xamarin.Forms.GoogleMaps" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
|
|||
SelectedBike.LockInfo.State = LockingState.UnknownDisconnected;
|
||||
}
|
||||
|
||||
BikesViewModel.ActionText = "Returning bike...";
|
||||
BikesViewModel.ActionText = AppResources.ActivityTextReturningBike;
|
||||
IsConnected = IsConnectedDelegate();
|
||||
|
||||
var feedBackUri = SelectedBike?.OperatorUri;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -153,7 +153,9 @@ namespace TINK.ViewModel.Info
|
|||
await Email.ComposeAsync(new EmailMessage
|
||||
{
|
||||
To = new List<string> { MailAddressText },
|
||||
Cc = APPSUPPORTMAILADDRESS.ToUpper() != MailAddressText.ToUpper() ? new List<string> { APPSUPPORTMAILADDRESS } : new List<string>(),
|
||||
Cc = APPSUPPORTMAILADDRESS.ToUpper() != MailAddressText.ToUpper() // do not sent copy if same mail adress
|
||||
&& MailAddressText != "konrad@sharee.bike" // do not sent copy if Meinkonrad
|
||||
? new List<string> { APPSUPPORTMAILADDRESS } : new List<string>(),
|
||||
Subject = string.Format(AppResources.SupportmailSubjectAppmail, AppFlavorName)
|
||||
});
|
||||
|
||||
|
|
|
@ -189,39 +189,8 @@ namespace TINK.ViewModel.Contact
|
|||
|
||||
Pins.Add(l_oPin);
|
||||
}
|
||||
|
||||
//Add blue dot for showing current location of user
|
||||
var status = await PermissionsService.CheckStatusAsync();
|
||||
if (status == Status.Granted)
|
||||
{
|
||||
Location currentLocation = null;
|
||||
try
|
||||
{
|
||||
currentLocation = await GeolocationService.GetAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
||||
}
|
||||
|
||||
if (currentLocation != null)
|
||||
{
|
||||
var currentLocationPin = new Pin()
|
||||
{
|
||||
Position = new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
||||
Label = "currentLocationPin",
|
||||
Type = PinType.Place,
|
||||
Tag = "NotClickable",
|
||||
Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName)
|
||||
};
|
||||
|
||||
Pins.Add(currentLocationPin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string currentLocationPinName = $"Location_Pin{(DeviceInfo.Platform == DevicePlatform.Android ? ".png" : string.Empty)}";
|
||||
|
||||
/// <summary> Update all stations from TINK. </summary>
|
||||
/// <param name="stationsColorList">List of colors to apply.</param>
|
||||
private void UpdatePinsColor(IList<Color> stationsColorList)
|
||||
|
@ -231,12 +200,6 @@ namespace TINK.ViewModel.Contact
|
|||
// Update colors of pins.
|
||||
for (int pinIndex = 0; pinIndex < stationsColorList.Count; pinIndex++)
|
||||
{
|
||||
if (Pins[pinIndex].Tag.ToString() == "NotClickable")
|
||||
{
|
||||
Pins[pinIndex].Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName);
|
||||
}
|
||||
else
|
||||
{
|
||||
var indexPartPrefix = int.TryParse(Pins[pinIndex].Tag.ToString(), out int stationId)
|
||||
&& stationId <= CUSTOM_ICONS_COUNT
|
||||
? $"{stationId}" // there is a station marker with index letter for given station id
|
||||
|
@ -255,7 +218,6 @@ namespace TINK.ViewModel.Contact
|
|||
Pins[pinIndex].Label = stationId.ToString();
|
||||
Pins[pinIndex].Icon = BitmapDescriptorFactory.DefaultMarker(stationsColorList[pinIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
Pins[pinIndex].IsVisible = true;
|
||||
}
|
||||
|
@ -487,9 +449,6 @@ namespace TINK.ViewModel.Contact
|
|||
/// <param name="selectedStationId">Id of station user clicked on.</param>
|
||||
public async void OnStationClicked(string selectedStationId)
|
||||
{
|
||||
//Make shure currentLocationPin can not be clicked
|
||||
if (selectedStationId != "NotClickable")
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.ForContext<SelectStationPageViewModel>().Information($"User taped station {selectedStationId}.");
|
||||
|
@ -527,11 +486,6 @@ namespace TINK.ViewModel.Contact
|
|||
"OK");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -560,26 +514,23 @@ namespace TINK.ViewModel.Contact
|
|||
var colors = new List<Color>();
|
||||
foreach (var stationId in stationsId)
|
||||
{
|
||||
if (stationId != "NotClickable")
|
||||
// Get color of given station.
|
||||
var bikesAtStation = bikesAll.Where(x => x.StationId == stationId).ToList();
|
||||
if (bikesAtStation.FirstOrDefault(x => x.State.Value.IsOccupied()) != null)
|
||||
{
|
||||
// Get color of given station.
|
||||
var bikesAtStation = bikesAll.Where(x => x.StationId == stationId).ToList();
|
||||
if (bikesAtStation.FirstOrDefault(x => x.State.Value.IsOccupied()) != null)
|
||||
{
|
||||
// There is at least one requested or booked bike
|
||||
colors.Add(Color.LightBlue);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bikesAtStation.ToList().Count > 0)
|
||||
{
|
||||
// There is at least one bike available
|
||||
colors.Add(Color.Green);
|
||||
continue;
|
||||
}
|
||||
|
||||
colors.Add(Color.Red);
|
||||
// There is at least one requested or booked bike
|
||||
colors.Add(Color.LightBlue);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bikesAtStation.ToList().Count > 0)
|
||||
{
|
||||
// There is at least one bike available
|
||||
colors.Add(Color.Green);
|
||||
continue;
|
||||
}
|
||||
|
||||
colors.Add(Color.Red);
|
||||
}
|
||||
|
||||
return colors;
|
||||
|
|
|
@ -201,7 +201,7 @@ namespace TINK.ViewModel.Map
|
|||
/// <summary>
|
||||
/// One time setup: Sets pins into map and connects to events.
|
||||
/// </summary>
|
||||
public async void InitializePins(StationDictionary stations)
|
||||
public void InitializePins(StationDictionary stations)
|
||||
{
|
||||
// Add pins to stations.
|
||||
Log.ForContext<MapPageViewModel>().Debug($"Request to draw {stations.Count} pins.");
|
||||
|
@ -228,39 +228,8 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
Pins.Add(pin);
|
||||
}
|
||||
|
||||
//Add blue dot for showing current location of user
|
||||
var status = await PermissionsService.CheckStatusAsync();
|
||||
if (status == Status.Granted)
|
||||
{
|
||||
Location currentLocation = null;
|
||||
try
|
||||
{
|
||||
currentLocation = await GeolocationService.GetAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Error("Getting location failed. {Exception}", ex);
|
||||
}
|
||||
|
||||
if (currentLocation != null)
|
||||
{
|
||||
var currentLocationPin = new Pin()
|
||||
{
|
||||
Position = new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
|
||||
Label = "currentLocationPin",
|
||||
Type = PinType.Place,
|
||||
Tag = "NotClickable",
|
||||
Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName)
|
||||
};
|
||||
|
||||
Pins.Add(currentLocationPin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string currentLocationPinName = $"Location_Pin{(DeviceInfo.Platform == DevicePlatform.Android ? ".png" : string.Empty)}";
|
||||
|
||||
/// <summary> Update all stations from TINK. </summary>
|
||||
/// <param name="stationsColorList">List of colors to apply.</param>
|
||||
private void UpdatePinsColor(IList<Color> stationsColorList)
|
||||
|
@ -270,12 +239,6 @@ namespace TINK.ViewModel.Map
|
|||
// Update colors of pins.
|
||||
for (int pinIndex = 0; pinIndex < stationsColorList.Count; pinIndex++)
|
||||
{
|
||||
if (Pins[pinIndex].Tag.ToString() == "NotClickable")
|
||||
{
|
||||
Pins[pinIndex].Icon = BitmapDescriptorFactory.FromBundle(currentLocationPinName);
|
||||
}
|
||||
else
|
||||
{
|
||||
var indexPartPrefix = int.TryParse(Pins[pinIndex].Tag.ToString(), out int stationId)
|
||||
&& stationId <= CUSTOM_ICONS_COUNT
|
||||
? $"{stationId}" // there is a station marker with index letter for given station id
|
||||
|
@ -294,7 +257,6 @@ namespace TINK.ViewModel.Map
|
|||
Pins[pinIndex].Label = stationId.ToString();
|
||||
Pins[pinIndex].Icon = BitmapDescriptorFactory.DefaultMarker(stationsColorList[pinIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
Pins[pinIndex].IsVisible = true;
|
||||
}
|
||||
|
@ -334,11 +296,6 @@ namespace TINK.ViewModel.Map
|
|||
return "Red";
|
||||
}
|
||||
|
||||
if (color == Color.Black)
|
||||
{
|
||||
return "NotClickable";
|
||||
}
|
||||
|
||||
return color.ToString();
|
||||
}
|
||||
|
||||
|
@ -694,9 +651,6 @@ namespace TINK.ViewModel.Map
|
|||
/// <param name="selectedStationId">Id of station user clicked on.</param>
|
||||
public async void OnStationClicked(string selectedStationId)
|
||||
{
|
||||
//Make shure currentLocationPin can not be clicked
|
||||
if (selectedStationId != "NotClickable")
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.ForContext<MapPageViewModel>().Information($"User taped station {selectedStationId}.");
|
||||
|
@ -732,11 +686,6 @@ namespace TINK.ViewModel.Map
|
|||
"OK");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -765,30 +714,23 @@ namespace TINK.ViewModel.Map
|
|||
var colors = new List<Color>();
|
||||
foreach (var stationId in stationsId)
|
||||
{
|
||||
if (stationId != "NotClickable")
|
||||
// Get color of given station.
|
||||
var bikesAtStation = bikesAll.Where(x => x.StationId == stationId).ToList();
|
||||
if (bikesAtStation.FirstOrDefault(x => x.State.Value.IsOccupied()) != null)
|
||||
{
|
||||
// Get color of given station.
|
||||
var bikesAtStation = bikesAll.Where(x => x.StationId == stationId).ToList();
|
||||
if (bikesAtStation.FirstOrDefault(x => x.State.Value.IsOccupied()) != null)
|
||||
{
|
||||
// There is at least one requested or booked bike
|
||||
colors.Add(Color.LightBlue);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bikesAtStation.ToList().Count > 0)
|
||||
{
|
||||
// There is at least one bike available
|
||||
colors.Add(Color.Green);
|
||||
continue;
|
||||
}
|
||||
|
||||
colors.Add(Color.Red);
|
||||
// There is at least one requested or booked bike
|
||||
colors.Add(Color.LightBlue);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
|
||||
if (bikesAtStation.ToList().Count > 0)
|
||||
{
|
||||
colors.Add(Color.Black);
|
||||
// There is at least one bike available
|
||||
colors.Add(Color.Green);
|
||||
continue;
|
||||
}
|
||||
|
||||
colors.Add(Color.Red);
|
||||
}
|
||||
|
||||
return colors;
|
||||
|
@ -924,7 +866,6 @@ namespace TINK.ViewModel.Map
|
|||
{
|
||||
try
|
||||
{
|
||||
IsRunning = true;
|
||||
ActionText = AppResources.ActivityTextCenterMap;
|
||||
|
||||
IsMapPageEnabled = false;
|
||||
|
@ -961,7 +902,6 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
if (currentLocation != null)
|
||||
{
|
||||
IsRunning = true;
|
||||
ActionText = AppResources.ActivityTextCenterMap;
|
||||
|
||||
TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
|
||||
|
@ -972,28 +912,6 @@ namespace TINK.ViewModel.Map
|
|||
|
||||
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
|
||||
|
||||
Pins.Clear();
|
||||
|
||||
// Update stations
|
||||
IsConnected = TinkApp.GetIsConnected();
|
||||
var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync();
|
||||
|
||||
// Set pins to their positions on map.
|
||||
ActionText = AppResources.ActivityTextMapLoadingStationsAndBikes;
|
||||
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.
|
||||
|
@ -1013,7 +931,6 @@ namespace TINK.ViewModel.Map
|
|||
}
|
||||
}
|
||||
|
||||
IsRunning = false;
|
||||
IsMapPageEnabled = true;
|
||||
Log.ForContext<MapPageViewModel>().Information($"Center to current Position done.");
|
||||
ActionText = String.Empty;
|
||||
|
@ -1030,7 +947,6 @@ namespace TINK.ViewModel.Map
|
|||
AppResources.MessageAnswerOk);
|
||||
|
||||
IsMapPageEnabled = true;
|
||||
IsRunning = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue