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

@ -21,6 +21,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Bar.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\BarLevelInputViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\BarLevelViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\NotConnectedToNetViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)View\BarLevelInputView.xaml.cs">
<DependentUpon>BarLevelInputView.xaml</DependentUpon>
<SubType>Code</SubType>
@ -29,6 +30,12 @@
<DependentUpon>BarLevelView.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\HintForRefreshingPageView.xaml.cs">
<DependentUpon>HintForRefreshingPageView.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\NotConnectedToNetView.xaml.cs">
<DependentUpon>NotConnectedToNetView.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\RunningProcessView.xaml.cs">
<DependentUpon>RunningProcessView.xaml</DependentUpon>
<SubType>Code</SubType>
@ -67,4 +74,16 @@
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\NotConnectedToNetView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\HintForRefreshingPageView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
</ItemGroup>
</Project>

View file

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="ShareeSharedGuiLib.View.HintForRefreshingPageView">
<StackLayout
Orientation="Horizontal"
HorizontalOptions="CenterAndExpand"
IsVisible="{Binding IsBikesDataOutdatedLabelVisible}"
Padding="0"
Spacing="0"
Margin="0">
<StackLayout.Triggers>
<DataTrigger TargetType="StackLayout"
Binding="{Binding IsBikesDataOutdatedLabelVisible}"
Value="false">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</StackLayout.Triggers>
<Image>
<Image.Source>
<FontImageSource
Glyph="{StaticResource ArrowDown}"
Color="DimGray"
FontFamily="FA-S"
Size="Small"/>
</Image.Source>
</Image>
<Label
TextColor="DimGray"
FontSize="Small"
Padding="5"
Text="{x:Static resources:AppResources.MarkingDataIsFromCache}"/>
</StackLayout>
</ContentView>

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShareeSharedGuiLib.ViewModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ShareeSharedGuiLib.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HintForRefreshingPageView : ContentView
{
public HintForRefreshingPageView()
{
InitializeComponent();
this.BindingContext = new NotConnectedToNetViewModel();
}
}
}

View file

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="ShareeSharedGuiLib.View.NotConnectedToNetView">
<StackLayout
BackgroundColor="{x:DynamicResource attention-color}"
IsVisible="{Binding IsNotConnectedToNet}"
Padding="0"
Spacing="0"
Margin="0">
<StackLayout.Triggers>
<DataTrigger TargetType="StackLayout"
Binding="{Binding IsNotConnectedToNet}"
Value="false">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</StackLayout.Triggers>
<Label Text="{x:Static resources:AppResources.MarkingNoNetworkConnection}"
TextColor="White"
FontSize="Small"
Padding="5"
HorizontalTextAlignment="Center"
HorizontalOptions="CenterAndExpand"/>
</StackLayout>
</ContentView>

View file

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ShareeSharedGuiLib.ViewModel;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ShareeSharedGuiLib.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class NotConnectedToNetView : ContentView, INotifyPropertyChanged
{
public NotConnectedToNetView()
{
InitializeComponent();
this.BindingContext = new NotConnectedToNetViewModel();
}
}
}

View file

@ -0,0 +1,54 @@
using System;
using System.ComponentModel;
using System.Threading.Tasks;
using TINK.MultilingualResources;
using Xamarin.Essentials;
namespace ShareeSharedGuiLib.ViewModel
{
public class NotConnectedToNetViewModel : INotifyPropertyChanged
{
public bool IsNotConnectedToNet { get; set; }
private bool _isBikesDataOutdatedLabelVisible = false;
public event PropertyChangedEventHandler PropertyChanged;
public bool IsBikesDataOutdatedLabelVisible
{
get { return _isBikesDataOutdatedLabelVisible; }
set
{
_isBikesDataOutdatedLabelVisible = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsBikesDataOutdatedLabelVisible)));
}
}
public NotConnectedToNetViewModel()
{
IsNotConnectedToNet = Connectivity.NetworkAccess != NetworkAccess.Internet;
// Register for connectivity changes, be sure to unsubscribe when finished
Connectivity.ConnectivityChanged += Connectivity_ConnectivityChanged;
}
public async void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e)
{
IsNotConnectedToNet = e.NetworkAccess != NetworkAccess.Internet;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsNotConnectedToNet)));
if (IsNotConnectedToNet)
{
IsBikesDataOutdatedLabelVisible = false;
}
else
{
IsBikesDataOutdatedLabelVisible = true;
await Task.Delay(TimeSpan.FromSeconds(5));
IsBikesDataOutdatedLabelVisible = false;
}
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsBikesDataOutdatedLabelVisible)));
}
}
}