Version 3.0.265

This commit is contained in:
Oliver Hauff 2021-12-08 20:03:50 +01:00
parent bf8e3fa73a
commit de8d5f8414
49 changed files with 959 additions and 286 deletions

View file

@ -28,11 +28,15 @@ namespace TINK.ViewModel.Bikes.Bike
return string.Empty;
#if USCSHARP9
return string.Format(AppResources.MessageBikesManagementTariffDescriptionTariffHeader, Tariff?.Name ?? "-", Tariff?.Number != null ? Tariff.Number : "-");
return Tariff?.Number != null
? string.Format(AppResources.MessageBikesManagementTariffDescriptionTariffHeaderNameId, Tariff?.Name ?? "-", Tariff?.Number != null ? Tariff.Number : "-");
: string.Format(AppResources.MessageBikesManagementTariffDescriptionTariffHeader, Tariff?.Name ?? "-");
#else
return string.Format(AppResources.MessageBikesManagementTariffDescriptionTariffHeader, Tariff?.Name ?? "-", Tariff?.Number != null ? Tariff.Number.ToString() : "-");
#endif
}
return Tariff?.Number != null
? string.Format(AppResources.MessageBikesManagementTariffDescriptionTariffHeaderNameId, Tariff?.Name ?? "-", Tariff?.Number != null ? Tariff.Number.ToString() : "-")
: string.Format(AppResources.MessageBikesManagementTariffDescriptionTariffHeader, Tariff?.Name ?? "-");
#endif
}
}
/// <summary>

View file

@ -433,15 +433,15 @@ namespace TINK.ViewModel.Map
if (currentLocation != null)
{
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
TinkApp.ActiveMapSpan.Radius);
TinkApp.Save();
}
}
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.MapSpan);
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
m_oViewUpdateManager = CreateUpdateTask();
@ -887,16 +887,16 @@ namespace TINK.ViewModel.Map
if (currentLocation != null)
{
TinkApp.MapSpan = MapSpan.FromCenterAndRadius(
TinkApp.UserMapSpan = MapSpan.FromCenterAndRadius(
new Xamarin.Forms.GoogleMaps.Position(currentLocation.Latitude, currentLocation.Longitude),
TinkApp.MapSpan.Radius);
TinkApp.ActiveMapSpan.Radius);
TinkApp.Save();
}
}
// Update stations
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.MapSpan);
MoveAndScale(m_oMoveToRegionDelegate, TinkApp.ActiveMapSpan);
IsConnected = TinkApp.GetIsConnected();
var resultStationsAndBikes = await TinkApp.GetConnector(IsConnected).Query.GetBikesAndStationsAsync();

View file

@ -9,21 +9,21 @@ namespace TINK.ViewModel.Settings
private bool m_bIsActivatedSwitch;
/// <summary> Constructs a filter object. </summary>
/// <param name="p_strKey">Key of the filter state.</param>
/// <param name="p_oFilterState">State of filter, on or off.</param>
/// <param name="p_bIsEnabled">If filter does not apply because user does not belong to group (TINK, Konrad, ...) filter is deactivated.</param>
/// <param name="p_strLabelText">Text of the switch describing the filter.</param>
/// <param name="key">Key of the filter state.</param>
/// <param name="filterState">State of filter, on or off.</param>
/// <param name="isEnabled">If filter does not apply because user does not belong to group (TINK, Konrad, ...) filter is deactivated.</param>
/// <param name="labelText">Text of the switch describing the filter.</param>
public FilterItemMutable(
string p_strKey,
FilterState p_oFilterState,
bool p_bIsEnabled,
string p_strLabelText)
string key,
FilterState filterState,
bool isEnabled,
string labelText)
{
Text = p_strLabelText;
IsEnabled = p_bIsEnabled;
State = p_oFilterState;
Key = p_strKey;
m_bIsActivatedSwitch = p_bIsEnabled && p_oFilterState == FilterState.On;
Text = labelText;
IsEnabled = isEnabled;
State = filterState;
Key = key;
m_bIsActivatedSwitch = isEnabled && filterState == FilterState.On;
}
/// <summary> Text describing the filter. </summary>

View file

@ -3,6 +3,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using TINK.Model;
using TINK.Model.Connector;
using TINK.MultilingualResources;
namespace TINK.ViewModel.Settings
{
@ -11,38 +12,38 @@ namespace TINK.ViewModel.Settings
public class SettingsBikeFilterViewModel : ObservableCollection<FilterItemMutable>
{
/// <summary> Constructs a filter collection object.</summary>
/// <param name="p_oFilterSettings">All available filters.</param>
/// <param name="p_oFilterGroupUser">Filters which apply to logged in user.</param>
/// <param name="filterSettings">All available filters.</param>
/// <param name="filterGroupUser">Filters which apply to logged in user.</param>
public SettingsBikeFilterViewModel(
IGroupFilterSettings p_oFilterSettings,
IEnumerable<string> p_oFilterGroupUser)
IGroupFilterSettings filterSettings,
IEnumerable<string> filterGroupUser)
{
foreach (var l_oFilter in p_oFilterSettings)
foreach (var filter in filterSettings)
{
if (l_oFilter.Key == FilterHelper.FILTERTINKGENERAL)
if (filter.Key == FilterHelper.FILTERTINKGENERAL)
{
Add(new FilterItemMutable(
l_oFilter.Key,
l_oFilter.Value,
p_oFilterGroupUser != null ? p_oFilterGroupUser.Contains(l_oFilter.Key) : true,
"TINK Lastenräder"));
filter.Key,
filter.Value,
(filterGroupUser != null && filterGroupUser.Count() > 0) ? filterGroupUser.Contains(filter.Key) : true,
AppResources.MarkingCargoBike));
continue;
}
if (l_oFilter.Key == FilterHelper.FILTERKONRAD)
if (filter.Key == FilterHelper.FILTERKONRAD)
{
Add(new FilterItemMutable(
l_oFilter.Key,
l_oFilter.Value,
p_oFilterGroupUser != null ? p_oFilterGroupUser.Contains(l_oFilter.Key) : true,
"Konrad Stadträder"));
filter.Key,
filter.Value,
(filterGroupUser != null && filterGroupUser.Count() > 0) ? filterGroupUser.Contains(filter.Key) : true,
AppResources.MarkingCityBike));
continue;
}
Add(new FilterItemMutable(
l_oFilter.Key,
l_oFilter.Value,
p_oFilterGroupUser != null ? p_oFilterGroupUser.Contains(l_oFilter.Key) : true,
l_oFilter.Key));
filter.Key,
filter.Value,
filterGroupUser != null ? filterGroupUser.Contains(filter.Key) : true,
filter.Key));
}
}
@ -51,13 +52,13 @@ namespace TINK.ViewModel.Settings
{
get
{
var l_Dictionary = new Dictionary<string, FilterState>();
foreach (var l_oEntry in this)
var dictionary = new Dictionary<string, FilterState>();
foreach (var entry in this)
{
l_Dictionary.Add(l_oEntry.Key, l_oEntry.State);
dictionary.Add(entry.Key, entry.State);
}
return l_Dictionary;
return dictionary;
}
}
}