Version 3.0.342

This commit is contained in:
Oliver Hauff 2022-10-03 17:55:10 +02:00
parent d852ccef4c
commit 2cde196f16
54 changed files with 998 additions and 498 deletions

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:conv="clr-namespace:TINK.View"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
@ -27,15 +27,11 @@
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
Text="{Binding DisplayId}"/>
<!-- Battery level -->
<!--<sharedGui:BarLevelView
<sharedGui:BarLevelView
Current="{Binding CurrentChargeBars}"
Maximum="{Binding MaxChargeBars}"
IsVisible="{Binding IsBatteryChargeVisible}"/>-->
<sharedGui:BarLevelView
Current="{Binding CurrentChargeBars}"
Maximum="{Binding MaxChargeBars}"
IsVisible="False"/>
<!-- Rental state -->
IsVisible="{Binding IsBatteryChargeVisible}"/>
<!-- Rental state -->
<Label
Text="{Binding StateText}"
TextColor="{Binding StateColor}"/>
@ -89,8 +85,6 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<!-- Operator AGB -->
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
@ -216,18 +210,7 @@
IsVisible="{Binding TariffDescription.InfoEntry5, Converter={StaticResource Label_Converter}}"
Grid.Row="14"
Grid.ColumnSpan="2"/>
<!-- AGB entry -->
<Label
TextType="Html"
Text="{Binding TariffDescription.OperatorAgb}"
IsVisible="{Binding TariffDescription.OperatorAgb, Converter={StaticResource Label_Converter}}"
Grid.ColumnSpan="2"
Grid.Row="15">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ShowAgbTappedCommand}"/>
</Label.GestureRecognizers>
</Label>
</Grid>
</StackLayout>
</ContentView>
</ViewCell>
</ViewCell>

View file

@ -25,7 +25,6 @@
Source="{Binding Uri}" />
<ActivityIndicator Grid.Row="0"
x:Name="ActivityIndicatorLoading"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"

View file

@ -1,4 +1,4 @@
using System.Globalization;
using System.Globalization;
using Serilog;
using TINK.Model.Device;
using TINK.ViewModel.Login;
@ -14,40 +14,12 @@ namespace TINK.View.CopriWebView
{
InitializeComponent();
ManageAccount.Navigating += (sender, ev) =>
{
if (!ev.Url.ToUpper().EndsWith(".PDF"))
{
// Stay inside web view except for downloading pdf- files.
this.IsEnabled = false;
ActivityIndicatorLoading.IsVisible = true;
ActivityIndicatorLoading.IsRunning = true;
return;
}
ManageAccount.Navigating += WebViewHelper.SetBusyAndDisplayOrDownload;
DependencyService.Get<IExternalBrowserService>().OpenUrl(ev.Url);
};
ManageAccount.Navigated += (sender, ev) =>
{
if (ev.Result == WebNavigationResult.Success)
{
this.IsEnabled = true;
ActivityIndicatorLoading.IsVisible = false;
ActivityIndicatorLoading.IsRunning = false;
return;
}
Log.ForContext<ManageAccountPage>().Error("Navigation did not succeed.{@Event}{@Sender}", ev, sender);
ManageAccount.Source = new HtmlWebViewSource
{
Html = "<html><b>Kann persönliche Daten nicht anzeigen/ verwalten!</b><br>Verbindung mit Internet ok?</html>"
};
this.IsEnabled = true;
ActivityIndicatorLoading.IsVisible = false;
ActivityIndicatorLoading.IsRunning = false;
};
ManageAccount.Navigated += (sender, eventArgs) => WebViewHelper.SetIdleAndHandleError(
sender,
eventArgs,
"<html><b>Kann persönliche Daten nicht anzeigen/ verwalten!</b><br>Verbindung mit Internet ok?</html>");
ManageAccount.BindingContext = new ManageAccountViewModel(
App.ModelRoot.ActiveUser.SessionCookie,
@ -56,4 +28,4 @@ namespace TINK.View.CopriWebView
App.ModelRoot.NextActiveUri.Host);
}
}
}
}

View file

@ -10,26 +10,51 @@
</Grid>
</Shell.TitleView>
<!--Pages can be added as references or inline-->
<ContentPage Title="{x:Static resources:AppResources.MarkingTabFees}">
<ContentPage
IsEnabled="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Title="{x:Static resources:AppResources.MarkingTabFees}">
<ContentPage.Content>
<StackLayout>
<WebView
x:Name="InfoRentBikeWebView"
HeightRequest="1000"
WidthRequest="1000"
Source="{Binding RentBikeText}"/>
</StackLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoRentBikeWebView"
HeightRequest="1000"
WidthRequest="1000"
Source="{Binding RentBikeText}"/>
<ActivityIndicator Grid.Row="0"
IsRunning="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
IsVisible="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid>
</ContentPage.Content>
</ContentPage>
<ContentPage Title="{x:Static resources:AppResources.MarkingTabBikes}">
<ContentPage
IsEnabled="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Title="{x:Static resources:AppResources.MarkingTabBikes}">
<ContentPage.Content>
<StackLayout>
<WebView
x:Name="InfoTypesOfBikesWebView"
HeightRequest="1000"
WidthRequest="1000"
Source="{Binding TypesOfBikesText}"/>
</StackLayout>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoTypesOfBikesWebView"
HeightRequest="1000"
WidthRequest="1000"
Source="{Binding TypesOfBikesText}"/>
<ActivityIndicator Grid.Row="0"
IsRunning="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
IsVisible="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid>
</ContentPage.Content>
</ContentPage>
</TabbedPage>
</TabbedPage>

View file

@ -1,4 +1,5 @@
using TINK.ViewModel;
using Serilog;
using TINK.ViewModel;
using TINK.ViewModel.Contact;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
@ -14,19 +15,31 @@ namespace TINK.View.Contact
{
InitializeComponent();
/// Info about renting.
InfoRentBikeWebView.Navigating += WebViewHelper.SelectDisplayTarget;
InfoRentBikeWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Mietinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
/// Info about types of bikes.
InfoTypesOfBikesWebView.Navigating += WebViewHelper.SelectDisplayTarget;
InfoTypesOfBikesWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Radinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
ViewModel = new FeesAndBikesPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.FeesResourcePath,
App.ModelRoot.ResourceUrls.BikesResourcePath,
App.ModelRoot.IsSiteCachingOn);
App.ModelRoot.IsSiteCachingOn,
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
BindingContext = ViewModel;
/// Info about renting.
InfoRentBikeWebView.Navigating += ViewModelHelper.OnNavigating;
/// Info about types of bikes.
InfoTypesOfBikesWebView.Navigating += ViewModelHelper.OnNavigating;
}
/// <summary> Called when page is shown. </summary>
@ -35,4 +48,4 @@ namespace TINK.View.Contact
ViewModel.OnAppearing();
}
}
}
}

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
@ -11,49 +11,96 @@
</Grid>
</Shell.TitleView>
<!--Pages can be added as references or inline-->
<ContentPage Title="App">
<ContentPage
IsEnabled="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Title="{x:Static resources:AppResources.MarkingTabApp}">
<ContentPage.Content>
<StackLayout>
<WebView
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoLicenses"
Source="{Binding InfoLicenses}"
HeightRequest="1000"
WidthRequest="1000" />
</StackLayout>
<ActivityIndicator Grid.Row="0"
IsRunning="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
IsVisible="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid>
</ContentPage.Content>
</ContentPage>
<ContentPage Title="Datenschutz">
<ContentPage
IsEnabled="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Title="{x:Static resources:AppResources.MarkingTabPrivacy}">
<ContentPage.Content>
<StackLayout>
<WebView
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoDatenschutz"
Source="{Binding InfoPrivacy}"
HeightRequest="1000"
WidthRequest="1000" />
</StackLayout>
<ActivityIndicator Grid.Row="0"
IsRunning="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
IsVisible="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid>
</ContentPage.Content>
</ContentPage>
<ContentPage Title="AGB">
<ContentPage
IsEnabled="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Title="{x:Static resources:AppResources.MarkingTabGtc}">
<ContentPage.Content>
<StackLayout>
<WebView
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoABG"
Source ="{Binding InfoAgb}"
HeightRequest="1000"
WidthRequest="1000" />
</StackLayout>
<ActivityIndicator Grid.Row="0"
IsRunning="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
IsVisible="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid>
</ContentPage.Content>
</ContentPage>
<ContentPage Title="Impressum">
<ContentPage
IsEnabled="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Title="{x:Static resources:AppResources.MarkingTabImpress}">
<ContentPage.Content>
<StackLayout>
<WebView
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoImpressum"
Source="{Binding InfoImpressum}"
HeightRequest="1000"
WidthRequest="1000" />
</StackLayout>
<ActivityIndicator Grid.Row="0"
IsRunning="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
IsVisible="{Binding IsIdle, Converter={StaticResource InvertedBoolConverter}}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid>
</ContentPage.Content>
</ContentPage>
</TabbedPage>

View file

@ -1,4 +1,4 @@
using System.Globalization;
using System.Globalization;
using TINK.ViewModel;
using TINK.ViewModel.Info;
using Xamarin.Forms;
@ -21,15 +21,34 @@ namespace TINK.View.Info
App.ModelRoot.ResourceUrls.PrivacyResourcePath,
App.ModelRoot.ResourceUrls.ImpressResourcePath,
App.ModelRoot.IsSiteCachingOn,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
resourceName => ViewModelResourceHelper.GetSource(resourceName));
resourceName => ViewModelResourceHelper.GetSource(resourceName),
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
TabbedInfoPage.BindingContext = ViewModel;
InfoLicenses.Navigating += ViewModelHelper.OnNavigating;
InfoDatenschutz.Navigating += ViewModelHelper.OnNavigating;
InfoABG.Navigating += ViewModelHelper.OnNavigating;
InfoLicenses.Navigating += WebViewHelper.SelectDisplayTarget;
InfoLicenses.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Lizenzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
InfoImpressum.Navigating += ViewModelHelper.OnNavigating;
InfoDatenschutz.Navigating += WebViewHelper.SelectDisplayTarget;
InfoDatenschutz.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Datenschutzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
InfoABG.Navigating += WebViewHelper.SelectDisplayTarget;
InfoABG.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann allgemeine Geschäftsbedingungen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
InfoImpressum.Navigating += WebViewHelper.SelectDisplayTarget;
InfoImpressum.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Impressum nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
}
/// <summary> Called when page is shown. </summary>
@ -38,4 +57,4 @@ namespace TINK.View.Info
ViewModel.OnAppearing();
}
}
}
}

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Globalization;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
@ -19,7 +19,6 @@ namespace TINK.View.WhatsNew.Agb
agbViewModel = new AgbViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.IsSiteCachingOn,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
(resourceName) => ViewModelResourceHelper.GetSource(resourceName),
this);
@ -81,4 +80,4 @@ namespace TINK.View.WhatsNew.Agb
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
}
}
}