Version 3.0.360

This commit is contained in:
Anja 2023-02-22 14:03:35 +01:00
parent 5c0b2e70c9
commit faf68061f4
160 changed files with 2114 additions and 1932 deletions

View file

@ -22,6 +22,7 @@ using TINK.Services.Permissions;
using TINK.Settings;
using TINK.View;
using TINK.ViewModel.Bikes;
using Xamarin.Essentials;
using Xamarin.Forms;
using Command = Xamarin.Forms.Command;
@ -46,6 +47,11 @@ namespace TINK.ViewModel.MyBikes
}
}
/// <summary>
/// Holds what should be executed on pull to refresh
/// </summary>
public Command RefreshCommand { get; }
/// <summary>
/// Constructs bike collection view model in case information about occupied bikes is available.
/// </summary>
@ -87,20 +93,14 @@ namespace TINK.ViewModel.MyBikes
Stations = stations ?? throw new ArgumentException(nameof(stations));
/// <summary>
/// Holds what should be executed on pull to refresh
/// </summary>
RefreshCommand = new Command(async () => {
IsRefreshing = true;
await OnAppearing();
IsRefreshing = false;
await OnAppearingOrRefresh();
});
}
public Command RefreshCommand { get; }
/// <summary> Returns if info about the fact that user did not request or book any bikes is visible or not.<summary>
/// Gets message that logged in user has not booked any bikes.
/// </summary>
@ -127,15 +127,20 @@ namespace TINK.ViewModel.MyBikes
/// Invoked when page is shown.
/// Starts update process.
/// </summary>
public async Task OnAppearing()
public async Task OnAppearingOrRefresh()
{
IsIdle = false;
IsConnected = IsConnectedDelegate();
// Get my bikes from COPRI
Log.ForContext<MyBikesPageViewModel>().Information("User request to show page MyBikes/ page re-appearing");
ActionText = AppResources.ActivityTextMyBikesLoadingBikes;
// Stop polling before getting bikes info.
await m_oViewUpdateManager.StopUpdatePeridically();
var bikesOccupied = await ConnectorFactory(IsConnected).Query.GetBikesOccupiedAsync();
Exception = bikesOccupied.Exception; // Update communication error from query for bikes occupied.
@ -178,7 +183,7 @@ namespace TINK.ViewModel.MyBikes
await OnAppearing(() => UpdateTask());
ActionText = "";
ActionText = string.Empty;
IsIdle = true;
return;
}
@ -200,7 +205,7 @@ namespace TINK.ViewModel.MyBikes
await OnAppearing(() => UpdateTask());
ActionText = "";
ActionText = string.Empty;
IsIdle = true;
return;
}
@ -217,7 +222,7 @@ namespace TINK.ViewModel.MyBikes
await OnAppearing(() => UpdateTask());
ActionText = "";
ActionText = string.Empty;
IsIdle = true;
return;
}
@ -244,7 +249,7 @@ namespace TINK.ViewModel.MyBikes
await OnAppearing(() => UpdateTask());
ActionText = "";
ActionText = string.Empty;
IsIdle = true;
}