Version 3.0.341

This commit is contained in:
Oliver Hauff 2022-09-22 20:58:30 +02:00
parent bad07e1ec9
commit d852ccef4c
26 changed files with 108 additions and 45 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
@ -112,7 +112,7 @@ namespace TINK.ViewModel.BikesAtStation
: AppResources.MarkingLoginRequiredToRerserve;
public string ContactSupportHintText
=> string.Format(AppResources.MarkingContactSupport, Station.OperatorData?.Name ?? "Operator");
=> string.Format(IsIdle ? AppResources.MarkingContactSupport : AppResources.MarkingContactSupportBusy, Station.OperatorData?.Name ?? "Operator");
/// <summary>
/// Returns if info about the fact that user did not request or book any bikes is visible or not.
@ -185,6 +185,12 @@ namespace TINK.ViewModel.BikesAtStation
{
try
{
if (!IsIdle)
{
// Prevent navigation when app is not idle because this might lead to aborting return bike workflow.
return;
}
// Switch to map page
#if USEFLYOUT
@ -211,7 +217,7 @@ namespace TINK.ViewModel.BikesAtStation
{
Log.ForContext<BikesAtStationPageViewModel>().Information($"Bikes at station {Station.StationName} is appearing, either due to tap on a station or to app being shown again.");
ActionText = "Einen Moment bitte...";
ActionText = AppResources.ActivityTextOneMomentPlease;
// Stop polling before getting bikes info.
await m_oViewUpdateManager.StopUpdatePeridically();
@ -225,7 +231,7 @@ namespace TINK.ViewModel.BikesAtStation
var bikesAtStation = bikesAll.Response.GetAtStation(Station.Id);
var lockIdList = bikesAtStation
.GetLockIt()
.Cast<Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo>()
.Cast<BikeInfo>()
.Select(x => x.LockInfo)
.ToList();
@ -234,7 +240,7 @@ namespace TINK.ViewModel.BikesAtStation
serviceFake.UpdateSimulation(bikesAtStation);
}
ActionText = AppResources.ActivityTextSearchBikes;
ActionText = AppResources.ActivityTextCheckBluetoothState;
// Check location permissions.
if (bikesAtStation.GetLockIt().Count > 0
@ -377,7 +383,8 @@ namespace TINK.ViewModel.BikesAtStation
base.IsIdle = value;
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsNoBikesAtStationVisible)));
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(NoBikesAtStationText)));
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(ContactSupportHintText)));
}
}
}
}
}

View file

@ -1,4 +1,4 @@

using System;
using System.Collections.Generic;
using System.Collections.Specialized;
@ -159,7 +159,7 @@ namespace TINK.ViewModel.FindBike
var lockIdList = bikeCollection
.GetLockIt()
.Cast<Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo>()
.Cast<BikeInfo>()
.Select(x => x.LockInfo)
.ToList();
@ -171,7 +171,7 @@ namespace TINK.ViewModel.FindBike
// Check bluetooth and location permission and states
ActionText = AppResources.ActivityTextCheckBluetoothState;
if (bikeCollection.FirstOrDefault(x => x is Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo btBike) != null
if (bikeCollection.FirstOrDefault(x => x is BikeInfo btBike) != null
&& RuntimePlatform == Device.Android)
{
// Check location permission

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
@ -112,7 +112,7 @@ namespace TINK.ViewModel.MyBikes
var lockIdList = bikesOccupied.Response
.GetLockIt()
.Cast<Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo>()
.Cast<BikeInfo>()
.Select(x => x.LockInfo)
.ToList();
@ -124,7 +124,7 @@ namespace TINK.ViewModel.MyBikes
// Check bluetooth and location permission and states
ActionText = AppResources.ActivityTextCheckBluetoothState;
if (bikesOccupied.Response.FirstOrDefault(x => x is Model.Bikes.BikeInfoNS.BluetoothLock.BikeInfo btBike) != null
if (bikesOccupied.Response.FirstOrDefault(x => x is BikeInfo btBike) != null
&& RuntimePlatform == Device.Android)
{
// Check location permission
@ -233,9 +233,16 @@ namespace TINK.ViewModel.MyBikes
base.IsIdle = value;
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsNoBikesOccupiedVisible)));
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(NoBikesOccupiedText)));
base.OnPropertyChanged(new PropertyChangedEventArgs(nameof(FlyoutBehavior))); // Hide flyout menu if app is busy. Prevents especially navigation on returning bike.
}
}
/// <summary>
/// Determines if flyout menu is available or not.
/// </summary>
public FlyoutBehavior FlyoutBehavior => base.IsIdle ? FlyoutBehavior.Flyout : FlyoutBehavior.Disabled;
/// <summary> Create task which updates my bike view model.</summary>
private void UpdateTask()
{