Version 3.0.376

This commit is contained in:
Anja 2023-11-21 15:26:57 +01:00
parent ca080c87c0
commit f963c0a219
158 changed files with 3228 additions and 1279 deletions

View file

@ -11,13 +11,13 @@
<ResourceDictionary>
<xct:InvertedBoolConverter x:Key="InvertedBoolConverter" />
<x:String x:Key="IconMap">&#xf5a0;</x:String>
<x:String x:Key="IconFindBike">&#xf002;</x:String>
<x:String x:Key="IconSelectBike">&#xf002;</x:String>
<x:String x:Key="IconMyBikes">&#xf206;</x:String>
<x:String x:Key="IconAccount">&#xf007;</x:String>
<x:String x:Key="IconLogin">&#xf2f6;</x:String>
<x:String x:Key="IconSettings">&#xf013;</x:String>
<x:String x:Key="IconFeesAndBikes">&#xf153;</x:String>
<!--<x:String x:Key="IconFeesAndBikes">&#xf3cd;</x:String>-->
<x:String x:Key="IconHelp">&#xf153;</x:String>
<!--<x:String x:Key="IconHelp">&#xf3cd;</x:String>-->
<x:String x:Key="IconContact">&#xf095;</x:String>
<!--<x:String x:Key="IconContact">&#xf0e0;</x:String>-->
<x:String x:Key="IconInfo">&#xf05a;</x:String>

View file

@ -27,7 +27,6 @@
<DependentUpon>ILockItBike.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\BoolInverterConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)View\Contact\SelectStationPage.xaml.cs">
<DependentUpon>SelectStationPage.xaml</DependentUpon>
<SubType>Code</SubType>
@ -36,11 +35,10 @@
<DependentUpon>FeedbackPopup.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\FindBike\FindBikePage.xaml.cs">
<DependentUpon>FindBikePage.xaml</DependentUpon>
<Compile Include="$(MSBuildThisFileDirectory)View\SelectBike\SelectBikePage.xaml.cs">
<DependentUpon>SelectBikePage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\ListViewAttachedBehavior.cs" />
<Compile Include="$(MSBuildThisFileDirectory)View\MiniSurvey\MiniSurveyPage.xaml.cs">
<DependentUpon>MiniSurveyPage.xaml</DependentUpon>
<SubType>Code</SubType>
@ -61,11 +59,10 @@
<Compile Include="$(MSBuildThisFileDirectory)View\RootShell\AppShell.xaml.cs">
<DependentUpon>AppShell.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\StringNotNullOrEmptyToVisibleConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)View\ViewTypesTypeProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Model\Device\SpecialFolder.cs" />
<Compile Include="$(MSBuildThisFileDirectory)View\FeesAndBikes\FeesAndBikesPage.xaml.cs">
<DependentUpon>FeesAndBikesPage.xaml</DependentUpon>
<Compile Include="$(MSBuildThisFileDirectory)View\Help\HelpPage.xaml.cs">
<DependentUpon>HelpPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\CopriWebView\ManageAccountPage.xaml.cs">
@ -80,8 +77,8 @@
<DependentUpon>PasswordForgottenPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\WhatsNew\Agb\AgbPage.xaml.cs">
<DependentUpon>AgbPage.xaml</DependentUpon>
<Compile Include="$(MSBuildThisFileDirectory)View\WhatsNew\Gtc\GtcPage.xaml.cs">
<DependentUpon>GtcPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\WhatsNew\WhatsNewPage.xaml.cs">
@ -97,8 +94,8 @@
<DependentUpon>ContactPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\Info\InfoTabbedPage.xaml.cs">
<DependentUpon>InfoTabbedPage.xaml</DependentUpon>
<Compile Include="$(MSBuildThisFileDirectory)View\LegalInformation\LegalInformationPage.xaml.cs">
<DependentUpon>LegalInformationPage.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\Login\LoginPage.xaml.cs">
@ -161,7 +158,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)View\BikesAtStation\" />
<Folder Include="$(MSBuildThisFileDirectory)View\FeesAndBikes\" />
<Folder Include="$(MSBuildThisFileDirectory)View\Help\" />
<Folder Include="$(MSBuildThisFileDirectory)View\Login\" />
<Folder Include="$(MSBuildThisFileDirectory)View\Map\" />
<Folder Include="$(MSBuildThisFileDirectory)View\MyBikes\" />
@ -174,13 +171,13 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\Info\InfoTabbedPage.xaml">
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\LegalInformation\LegalInformationPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\FeesAndBikes\FeesAndBikesPage.xaml">
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\Help\HelpPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
@ -192,7 +189,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\WhatsNew\Agb\AgbPage.xaml">
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\WhatsNew\Gtc\GtcPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</EmbeddedResource>
@ -246,7 +243,7 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\FindBike\FindBikePage.xaml">
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\SelectBike\SelectBikePage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:conv="clr-namespace:TINK.View"
xmlns:conv="clr-namespace:TINK.View;assembly=TINKLib"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:conv="clr-namespace:TINK.View"
xmlns:conv="clr-namespace:TINK.View;assembly=TINKLib"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:conv="clr-namespace:TINK.View"
xmlns:conv="clr-namespace:TINK.View;assembly=TINKLib"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Contact.ContactPage">

View file

@ -3,7 +3,7 @@ using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
using TINK.ViewModel.Info;
using TINK.ViewModel.Contact;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View file

@ -0,0 +1,59 @@
<?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"
x:Class="TINK.View.Help.HelpPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingHelp}"/>
</Grid>
</Shell.TitleView>
<!--Pages can be added as references or inline-->
<ContentPage
IsEnabled="{Binding IsIdle}"
Title="{x:Static resources:AppResources.MarkingTabManual}">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="ManualWebView"
HeightRequest="1000"
WidthRequest="1000"
Source="{Binding ManualHtml}"/>
<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
IsEnabled="{Binding IsIdle}"
Title="{x:Static resources:AppResources.MarkingTabTariffs}">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="TariffsWebView"
HeightRequest="1000"
WidthRequest="1000"
Source="{Binding TariffsHtml}"/>
<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

@ -0,0 +1,54 @@
using System.Globalization;
using Serilog;
using TINK.ViewModel;
using TINK.ViewModel.Help;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.Help
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HelpPage : TabbedPage
{
public HelpPageViewModel ViewModel { get; }
public HelpPage()
{
InitializeComponent();
/// Info about renting.
TariffsWebView.Navigating += WebViewHelper.SelectDisplayTarget;
TariffsWebView.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.
ManualWebView.Navigating += WebViewHelper.SelectDisplayTarget;
ManualWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Radinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
ViewModel = new HelpPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.TariffsResourcePath,
App.ModelRoot.ResourceUrls.ManualResourcePath,
App.ModelRoot.IsSiteCachingOn,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
this.BindingContext = ViewModel;
}
/// <summary> Called when page is shown. </summary>
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}

View file

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<CarouselPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.Info.BikeInfo.BikeInfoCarouselPage">
<CarouselPage.ItemTemplate>
<DataTemplate>
<ContentPage>
<ContentPage.Padding>
<OnPlatform x:TypeArguments="Thickness">
<On Platform="iOS" Value="0,40,0,0" />
</OnPlatform>
</ContentPage.Padding>
<ScrollView Orientation="Vertical">
<StackLayout>
<Label
Text="{Binding Title}"
FontSize="Medium"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
VerticalOptions="EndAndExpand"
VerticalTextAlignment="End"/>
<Image
IsVisible="{Binding IsImageVisble}"
Source="{Binding Image}"
Aspect="AspectFit"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
<Label
Text="{Binding DescriptionText}"
HorizontalOptions="Center"
HorizontalTextAlignment="Center"
VerticalOptions="StartAndExpand"
VerticalTextAlignment="Start"/>
<Button
Text="Schließen"
IsVisible="{Binding IsCloseVisible}"
Command="{Binding OnCloseRequest}"
VerticalOptions="End"/>
<ProgressBar
VerticalOptions="End"
Progress="{Binding ProgressValue}"/>
</StackLayout>
</ScrollView>
</ContentPage>
</DataTemplate>
</CarouselPage.ItemTemplate>
</CarouselPage>

View file

@ -0,0 +1,40 @@
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class InfoPage : ContentPage
{
public InfoPage ()
{
InitializeComponent ();
#if __IOS__
var resourcePrefix = "TINK.iOS.";
#endif
#if __ANDROID__
var resourcePrefix = "TINK.Droid.";
#endif
#if WINDOWS_PHONE
var resourcePrefix = "TINK.WinPhone.";
#endif
Debug.WriteLine("Using this resource prefix: " + resourcePrefix);
// note that the prefix includes the trailing period '.' that is required
var assembly = typeof(InfoPage).GetTypeInfo().Assembly;
Stream stream = assembly.GetManifestResourceStream
(resourcePrefix + "HtmlResouces.Info.html");
var l_oHtmlViewSource = new HtmlWebViewSource
{
Html = (new StreamReader(stream, Encoding.UTF8)).ReadToEnd()
};
InfoWebView.Source = l_oHtmlViewSource;
}
}
}

View file

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.Info
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class InfoPage : ContentPage
{
public InfoPage ()
{
InitializeComponent ();
}
}
}

View file

@ -0,0 +1,105 @@
<?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"
x:Class="TINK.View.LegalInformation.LegalInformationPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingLegalInformation}"/>
</Grid>
</Shell.TitleView>
<!--Pages can be added as references or inline-->
<ContentPage
IsEnabled="{Binding IsIdle}"
Title="{x:Static resources:AppResources.MarkingTabApp}">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="InfoLicenses"
Source="{Binding AppHtml}"
HeightRequest="1000"
WidthRequest="1000" />
<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
IsEnabled="{Binding IsIdle}"
Title="{x:Static resources:AppResources.MarkingTabPrivacy}">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="PrivacyWebView"
Source="{Binding PrivacyHtml}"
HeightRequest="1000"
WidthRequest="1000" />
<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
IsEnabled="{Binding IsIdle}"
Title="{x:Static resources:AppResources.MarkingTabGtc}">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="GtcWebView"
Source ="{Binding GtcHtml}"
HeightRequest="1000"
WidthRequest="1000" />
<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
IsEnabled="{Binding IsIdle}"
Title="{x:Static resources:AppResources.MarkingTabImpress}">
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WebView
x:Name="ImpressWebView"
Source="{Binding ImpressHtml}"
HeightRequest="1000"
WidthRequest="1000" />
<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

@ -0,0 +1,60 @@
using System.Globalization;
using TINK.ViewModel;
using TINK.ViewModel.LegalInformation;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.LegalInformation
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LegalInformationPage : TabbedPage
{
public LegalInformationPageViewModel ViewModel { get; }
public LegalInformationPage()
{
InitializeComponent();
ViewModel = new LegalInformationPageViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.ResourceUrls.GtcResourcePath,
App.ModelRoot.ResourceUrls.PrivacyResourcePath,
App.ModelRoot.ResourceUrls.ImpressResourcePath,
App.ModelRoot.IsSiteCachingOn,
resourceName => ViewModelResourceHelper.GetSource(resourceName),
() => App.ModelRoot.GetConnector(App.ModelRoot.GetIsConnected()).Query,
resourceUrls => App.ModelRoot.ResourceUrls = resourceUrls);
this.BindingContext = ViewModel;
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>");
PrivacyWebView.Navigating += WebViewHelper.SelectDisplayTarget;
PrivacyWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann Datenschutzinformationen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
GtcWebView.Navigating += WebViewHelper.SelectDisplayTarget;
GtcWebView.Navigated += (sender, ev) => WebViewHelper.HandleError(
sender,
ev,
"<html><b>Kann allgemeine Geschäftsbedingungen nicht anzeigen!</b><br>Verbindung mit Internet ok?</html>");
ImpressWebView.Navigating += WebViewHelper.SelectDisplayTarget;
ImpressWebView.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>
protected override void OnAppearing()
{
ViewModel.OnAppearing();
}
}
}

View file

@ -10,7 +10,7 @@
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingMapPage}"/>
Text="{x:Static resources:AppResources.MarkingBikeLocations}"/>
</Grid>
</Shell.TitleView>

View file

@ -3,13 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:mappage="clr-namespace:TINK.View.Map"
xmlns:findbike="clr-namespace:TINK.View.FindBike"
xmlns:findbike="clr-namespace:TINK.View.SelectBike"
xmlns:mybikes="clr-namespace:TINK.View.MyBikes"
xmlns:account="clr-namespace:TINK.View.Account"
xmlns:login="clr-namespace:TINK.View.Login"
xmlns:settings="clr-namespace:TINK.View.Settings"
xmlns:contact="clr-namespace:TINK.View.Contact"
xmlns:info="clr-namespace:TINK.View.Info"
xmlns:info="clr-namespace:TINK.View.LegalInformation"
xmlns:help="clr-namespace:TINK.View.Help"
xmlns:header="clr-namespace:TINK.View.RootShell"
xmlns:version="clr-namespace:ShareeSharedGuiLib.View"
BackgroundColor="{DynamicResource Key=primary-back-title-color}"
@ -21,7 +22,7 @@
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingMapPage}"
Title="{x:Static resources:AppResources.MarkingBikeLocations}"
Route="MapPage"
ContentTemplate="{DataTemplate mappage:MapPage}">
<ShellContent.FlyoutIcon>
@ -31,11 +32,11 @@
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingFindBike}"
IsVisible="{Binding IsFindBikePageVisible}"
ContentTemplate="{DataTemplate findbike:FindBikePage}">
Title="{x:Static resources:AppResources.MarkingSelectBike}"
IsVisible="{Binding IsSelectBikePageVisible}"
ContentTemplate="{DataTemplate findbike:SelectBikePage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconFindBike}" Color="Black" FontFamily="FA-S" />
<FontImageSource Glyph="{StaticResource IconSelectBike}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
@ -70,27 +71,18 @@
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingSettings}"
ContentTemplate="{DataTemplate settings:SettingsPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconSettings}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconSettings}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingFeesAndBikes}"
ContentTemplate="{DataTemplate contact:FeesAndBikesPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconFeesAndBikes}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingFeedbackAndContact}"
Title="{x:Static resources:AppResources.MarkingContact}"
Route="ContactPage"
ContentTemplate="{DataTemplate contact:ContactPage}">
<ShellContent.FlyoutIcon>
@ -98,10 +90,19 @@
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingHelp}"
ContentTemplate="{DataTemplate help:HelpPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconHelp}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{Binding TabbedPageIngoTitle}"
ContentTemplate="{DataTemplate info:InfoPage}">
Title="{x:Static resources:AppResources.MarkingLegalInformation}"
ContentTemplate="{DataTemplate info:LegalInformationPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconInfo}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.SelectBike.SelectBikePage"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:local_bike="clr-namespace:TINK.View.Bike"
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingSelectBike}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Frame>
<!--Grid for Bike(s) view and Running process in same row-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--Search bike-->
<StackLayout Grid.Row="0">
<Entry
Placeholder="{x:Static resources:AppResources.PlaceholderSelectBike}"
IsVisible="{Binding IsSelectBikeVisible}"
MaxLength="10"
CursorPosition="0"
Text="{Binding BikeIdUserInput}"/>
<Button
Text="{x:Static resources:AppResources.MarkingSelectBike}"
IsEnabled="{Binding IsSelectBikeEnabled}"
IsVisible="{Binding IsSelectBikeVisible}"
Command="{Binding OnSelectBikeRequest}"/>
<ListView
x:Name="SelectBikeListView"
SelectionMode="None"
SelectedItem="{Binding SelectedBike}"
IsEnabled="{Binding IsIdle}"
IsVisible="{Binding IsBikesListVisible}"
HasUnevenRows="True"
ItemTemplate="{StaticResource bikeTemplateSelector}"/>
</StackLayout>
<!--While process is running-->
<sharedGui:RunningProcessViewBay
Grid.Row="0"
IsVisible="{Binding IsProcessWithRunningProcessView}"/>
</Grid>
</Frame>
</ContentPage.Content>
</ContentPage>

View file

@ -0,0 +1,183 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Serilog;
using TINK.Model;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
using TINK.MultilingualResources;
using TINK.ViewModel.SelectBike;
using Xamarin.CommunityToolkit.Extensions;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.SelectBike
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class SelectBikePage : ContentPage, IViewService
{
/// <summary> Reference to view model. </summary>
SelectBikePageViewModel m_oViewModel = null;
/// <summary>
/// Holds a value indicating whether page already subscribed to shell item changes or not.
/// </summary>
private bool _IsShellItemChangedReceived = false;
public SelectBikePage() { }
/// <summary>
/// Invoked when page is shown.
/// Starts update process.
/// </summary>
protected async override void OnAppearing()
{
if (m_oViewModel != null)
{
// No need to create view model, set binding context an items source if already done.
// If done twice tap events are fired multiple times (when hiding page using home button).
await m_oViewModel.OnAppearingOrRefresh();
return;
}
try
{
var model = App.ModelRoot;
m_oViewModel = new SelectBikePageViewModel(
model.ActiveUser,
model,
App.PermissionsService,
App.BluetoothService,
Device.RuntimePlatform,
() => model.GetIsConnected(),
(isConnected) => model.GetConnector(isConnected),
App.LocationServicesContainer.Active,
model.LocksServices.Active,
model.Stations,
model.Polling,
model.PostAction,
model.SmartDevice,
this,
(url) => DependencyService.Get<IExternalBrowserService>().OpenUrl(url))
{
IsReportLevelVerbose = model.IsReportLevelVerbose
};
}
catch (Exception exception)
{
Log.ForContext<SelectBikePage>().Error("Displaying bikes at station page failed. {Exception}", exception);
await DisplayAlert(
AppResources.ErrorPageNotLoadedTitle,
$"{AppResources.ErrorPageNotLoaded}\r\n{exception.Message}",
AppResources.MessageAnswerOk);
return;
}
InitializeComponent();
BindingContext = m_oViewModel;
SelectBikeListView.ItemsSource = m_oViewModel;
await m_oViewModel.OnAppearingOrRefresh();
}
/// <summary>
/// Invoked when page is disappearing to
/// - stop the update process
/// - to subscribe to events.
/// </summary>
protected async override void OnDisappearing()
{
if (!_IsShellItemChangedReceived && Shell.Current != null)
{
// Subscribe to events.
// Do not do this on startup because Shell.Current is null, if FindeBikePage is startup page.
Shell.Current.Navigated += (sender, e) =>
{
if (e.Source != ShellNavigationSource.ShellItemChanged)
{
// Nothing to do.
return;
}
// Reset previous user input after switch of pages to allow user to select a differnt bike if one has been selected before.
m_oViewModel.BikeIdUserInput = String.Empty;
};
}
_IsShellItemChangedReceived = true;
await (m_oViewModel?.OnDisappearing() ?? Task.CompletedTask);
}
/// <summary>
/// Displays alert message.
/// </summary>
/// <param name="p_strTitle">Title of message.</param>
/// <param name="p_strMessage">Message to display.</param>
/// <param name="p_strCancel">Type of buttons.</param>
public new async Task DisplayAlert(string p_strTitle, string p_strMessage, string p_strCancel)
=> await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strCancel);
/// <summary> Displays alert message.</summary>
/// <param name="title">Title of message.</param>
/// <param name="message">Message to display.</param>
/// <param name="details">Detailed error description.</param>
/// <param name="cancel">Type of buttons.</param>
public async Task DisplayAdvancedAlert(
string title,
string message,
string details,
string cancel)
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
/// <summary> Displays detailed alert message.</summary>
/// <param name="title">Title of message.</param>
/// <param name="message">Message to display.</param>
/// <param name="details">Detailed error description.</param>
/// <param name="accept">Text of accept button.</param>
/// <param name="cancel">Text of cancel button.</param>
/// <returns>True if user pressed accept.</returns>
public async Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
=> await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
/// <summary>
/// Displays alert message.
/// </summary>
/// <param name="p_strTitle">Title of message.</param>
/// <param name="p_strMessage">Message to display.</param>
/// <param name="p_strAccept">Text of accept button.</param>
/// <param name="p_strCancel">Text of button.</param>
/// <returns>True if user pressed accept.</returns>
public new async Task<bool> DisplayAlert(string p_strTitle, string p_strMessage, string p_strAccept, string p_strCancel)
=> await App.Current.MainPage.DisplayAlert(p_strTitle, p_strMessage, p_strAccept, p_strCancel);
/// <summary> Shows a page.</summary>
/// <param name="route">Route of the page to show.</param>
public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
/// <summary> Pushes a page onto the modal stack. </summary>
/// <param name="typeOfPage">Page to display.</param>
public async Task PushModalAsync(ViewTypes typeOfPage)
=> await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
/// <summary> Pops a page from the modal stack. </summary>
public Task PopModalAsync() => throw new NotSupportedException();
/// <summary> Pushes a page onto the stack. </summary>
/// <param name="p_oTypeOfPage">Page to display.</param>
public Task PushAsync(ViewTypes p_oTypeOfPage) => throw new NotSupportedException();
#if USCSHARP9
public async Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup());
#else
/// <summary> Displays user feedback popup.</summary>
/// <param name="co2Saving"> Co2 saving information.</param>
/// <returns>User feedback.</returns>
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBatteryMutable battery = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery));
#endif
}
}

View file

@ -2,14 +2,15 @@ using System;
using TINK.View.BikesAtStation;
using TINK.View.Contact;
using TINK.View.CopriWebView;
using TINK.View.Info;
using TINK.View.LegalInformation;
using TINK.View.Help;
using TINK.View.Login;
using TINK.View.Map;
using TINK.View.MiniSurvey;
using TINK.View.MyBikes;
using TINK.View.Settings;
using TINK.View.WhatsNew;
using TINK.View.WhatsNew.Agb;
using TINK.View.WhatsNew.Gtc;
using Xamarin.Forms;
namespace TINK.View
@ -38,17 +39,17 @@ namespace TINK.View
case ViewTypes.SettingsPage:
return typeof(SettingsPage);
case ViewTypes.TabbedPageInfo:
return typeof(InfoPage);
case ViewTypes.LegalInformationPage:
return typeof(LegalInformationPage);
case ViewTypes.FeesAndBikesPage:
return typeof(FeesAndBikesPage);
case ViewTypes.HelpPage:
return typeof(HelpPage);
case ViewTypes.ManageAccountPage:
return typeof(ManageAccountPage);
case ViewTypes.AgbPage:
return typeof(AgbPage);
case ViewTypes.GtcPage:
return typeof(GtcPage);
case ViewTypes.WhatsNewPage:
return typeof(WhatsNewPage);

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.WhatsNew.Gtc.GtcPage">
<ContentPage.Content>
<Frame>
<StackLayout>
<WebView
HeightRequest="1000"
WidthRequest="500"
Source="{Binding GtcHtml}"/>
<Button
Text="OK"
WidthRequest="100"
Command="{Binding OnOk}"
Margin="0,0,0,3"/>
</StackLayout>
</Frame>
</ContentPage.Content>
</ContentPage>

View file

@ -0,0 +1,78 @@
using System;
using System.Globalization;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.ViewModel;
using TINK.ViewModel.WhatsNew.Gtc;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace TINK.View.WhatsNew.Gtc
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class GtcPage : ContentPage, IViewService
{
public GtcPage()
{
InitializeComponent();
gtcViewModel = new GtcViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.IsSiteCachingOn,
(resourceName) => ViewModelResourceHelper.GetSource(resourceName),
this);
BindingContext = gtcViewModel;
}
/// <summary> Displays alert message.</summary>
/// <param name="title">Title of message.</param>
/// <param name="message">Message to display.</param>
/// <param name="details">Detailed error description.</param>
/// <param name="cancel">Type of buttons.</param>
public async Task DisplayAdvancedAlert(
string title,
string message,
string details,
string cancel)
=> await App.Current.MainPage.DisplayAlert(title, $"{message}\r\nDetails:\r\n{details}", cancel);
/// <summary> Displays detailed alert message.</summary>
/// <param name="title">Title of message.</param>
/// <param name="message">Message to display.</param>
/// <param name="details">Detailed error description.</param>
/// <param name="accept">Text of accept button.</param>
/// <param name="cancel">Text of cancel button.</param>
/// <returns>True if user pressed accept.</returns>
public async Task<bool> DisplayAdvancedAlert(string title, string message, string details, string accept, string cancel)
=> await App.Current.MainPage.DisplayAlert(title, !string.IsNullOrEmpty(details) ? $"{message}\r\nDetails:\r\n{details}" : $"{message}", accept, cancel);
/// <summary> Invoked when page is shown. </summary>
protected async override void OnAppearing()
=> await gtcViewModel.OnAppearing();
/// <summary> Reference to view model.</summary>
GtcViewModel gtcViewModel;
public async Task PopModalAsync()
=> await Navigation.PopModalAsync();
/// <summary> Pushes a page onto the stack. </summary>
/// <param name="p_oTypeOfPage">Page to display.</param>
public Task PushAsync(ViewTypes p_oTypeOfPage)
=> throw new NotImplementedException();
public Task PushModalAsync(ViewTypes p_oTypeOfPage)
=> throw new NotImplementedException();
/// <summary> Shows a page.</summary>
/// <param name="route">Route of the page to show.</param>
public async Task ShowPage(string route) => await Shell.Current.GoToAsync(route);
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBatteryMutable battery = null) => throw new NotSupportedException();
#endif
}
}

View file

@ -3,7 +3,7 @@ using TINK.MultilingualResources;
using TINK.Services;
using TINK.Services.CopriApi.ServerUris;
using TINK.View.Themes;
using TINK.ViewModel.Info;
using TINK.ViewModel.LegalInformation;
namespace TINK.ViewModel.RootShell
{
@ -15,7 +15,7 @@ namespace TINK.ViewModel.RootShell
{
// Login state changed. Update related menu entries.
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsMyBikesPageVisible)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsFindBikePageVisible)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsSelectBikePageVisible)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsAccountPageVisible)));
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsLoginPageVisible)));
};
@ -56,13 +56,13 @@ namespace TINK.ViewModel.RootShell
public bool IsMyBikesPageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
public bool IsFindBikePageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
public bool IsSelectBikePageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
public bool IsAccountPageVisible => App.ModelRoot.ActiveUser.IsLoggedIn;
public bool IsLoginPageVisible => !App.ModelRoot.ActiveUser.IsLoggedIn;
public string TabbedPageIngoTitle => AppResources.MarkingAbout;
public string TabbedPageIngoTitle => AppResources.MarkingLegalInformation;
}
}