Version 3.0.339

This commit is contained in:
Anja 2022-09-16 11:19:46 +02:00
parent 0468955d49
commit 52c9f6f1d9
43 changed files with 993 additions and 614 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.338" android:versionCode="338"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.LastenradBayern" android:versionName="3.0.339" android:versionCode="339">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" /> <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions --> <!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services --> <!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
@ -55,8 +55,8 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>LastenradBayern</string> <string>LastenradBayern</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>338</string> <string>339</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.338</string> <string>3.0.339</string>
</dict> </dict>
</plist> </plist>

View file

@ -11,6 +11,7 @@
xmlns:contact="clr-namespace:TINK.View.Contact" xmlns:contact="clr-namespace:TINK.View.Contact"
xmlns:info="clr-namespace:TINK.View.Info" xmlns:info="clr-namespace:TINK.View.Info"
xmlns:header="clr-namespace:TINK.View.RootShell" xmlns:header="clr-namespace:TINK.View.RootShell"
xmlns:version="clr-namespace:ShareeSharedGuiLib.View"
BackgroundColor="{DynamicResource Key=primary-back-title-color}" BackgroundColor="{DynamicResource Key=primary-back-title-color}"
Title="Shell" Title="Shell"
x:Class="TINK.View.RootShell.AppShell"> x:Class="TINK.View.RootShell.AppShell">
@ -107,4 +108,8 @@
</ShellContent.FlyoutIcon> </ShellContent.FlyoutIcon>
</ShellContent> </ShellContent>
</FlyoutItem> </FlyoutItem>
<Shell.FlyoutFooter>
<version:VersionNumberView/>
</Shell.FlyoutFooter>
</Shell> </Shell>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.338" android:versionCode="338"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.TeilRad.Meinkonrad" android:versionName="3.0.339" android:versionCode="339">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" /> <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions --> <!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services --> <!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
@ -55,8 +55,8 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>Mein konrad</string> <string>Mein konrad</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>338</string> <string>339</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.338</string> <string>3.0.339</string>
</dict> </dict>
</plist> </plist>

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" <ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:conv="clr-namespace:TINK.View" xmlns:conv="clr-namespace:TINK.View"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
@ -15,14 +15,9 @@
<StackLayout <StackLayout
Padding="10"> Padding="10">
<Grid Padding="0,0,5,10"> <Grid Padding="0,0,5,10">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="80" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!-- Icon of the bike --> <!-- Icon of the bike -->
@ -31,35 +26,29 @@
HeightRequest="80" HeightRequest="80"
Aspect="AspectFit" Aspect="AspectFit"
HorizontalOptions="Start" HorizontalOptions="Start"
Grid.Row="0" VerticalOptions="End"
Grid.RowSpan="2" Grid.Column="0"/>
Grid.Column="0"
Grid.ColumnSpan="2"/>
<!-- Battery level --> <!-- Battery level -->
<sharedGui:BarLevelView <sharedGui:BarLevelView
Current="{Binding CurrentChargeBars}" Current="{Binding CurrentChargeBars}"
Maximum="{Binding MaxChargeBars}" Maximum="{Binding MaxChargeBars}"
Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="2" VerticalOptions="End"
IsVisible="{Binding IsBatteryChargeVisible}"/> IsVisible="{Binding IsBatteryChargeVisible}"/>
<!-- Name of the bike --> <!-- Name of the bike -->
<StackLayout Grid.Column="2">
<Label <Label
FontAttributes="Bold" FontAttributes="Bold"
FontSize="Large" FontSize="Large"
HorizontalTextAlignment="Right" HorizontalTextAlignment="Right"
Text="{Binding Name}" Text="{Binding Name}"/>
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="3"/>
<!-- Id of the bike --> <!-- Id of the bike -->
<Label <Label
FontAttributes="Bold" FontAttributes="Bold"
HorizontalTextAlignment="Right" HorizontalTextAlignment="Right"
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}" IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
Text="{Binding DisplayId}" Text="{Binding DisplayId}"/>
Grid.Row="1" </StackLayout>
Grid.Column="3"/>
</Grid> </Grid>
<!-- Rental state --> <!-- Rental state -->
<Label <Label

View file

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:version="clr-namespace:ShareeSharedGuiLib.View"
xmlns:local="clr-namespace:TINK.View;assembly=TINKLib" xmlns:local="clr-namespace:TINK.View;assembly=TINKLib"
x:Class="TINK.View.RootShell.FlyoutFooter"> x:Class="TINK.View.RootShell.FlyoutFooter">
<Grid Padding="20,0,0,20"> <ContentView.Content>
<Grid Padding="20,0,0,0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="35" /> <RowDefinition Height="35" />
<RowDefinition Height="20"/> <RowDefinition Height="20"/>
<RowDefinition Height="30" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Image <Image
Grid.Row="0" Grid.Row="0"
@ -22,7 +25,7 @@
TextType="Html" TextType="Html"
Text="Powered by &lt;b&gt;Stadtwerke Konstanz&lt;/b&gt;"/> Text="Powered by &lt;b&gt;Stadtwerke Konstanz&lt;/b&gt;"/>
<!--<Label <!--<Label
Grid.Row="1" Grid.Row="2"
HorizontalOptions="Start" HorizontalOptions="Start"
FontSize="12" FontSize="12"
TextColor="{DynamicResource primary-back-title-color}"> TextColor="{DynamicResource primary-back-title-color}">
@ -35,5 +38,7 @@
</FormattedString> </FormattedString>
</Label.FormattedText> </Label.FormattedText>
</Label>--> </Label>-->
<version:VersionNumberView x:Name="VersionNumber" Grid.Row="2"/>
</Grid> </Grid>
</ContentView.Content>
</ContentView> </ContentView>

View file

@ -12,6 +12,10 @@
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\BarLevelView.xaml"> <EmbeddedResource Include="$(MSBuildThisFileDirectory)View\BarLevelView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\VersionNumberView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Bar.cs" /> <Compile Include="$(MSBuildThisFileDirectory)ViewModel\Bar.cs" />
@ -25,10 +29,23 @@
<DependentUpon>BarLevelView.xaml</DependentUpon> <DependentUpon>BarLevelView.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\RunningProcessView.xaml.cs">
<DependentUpon>RunningProcessView.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\VersionNumberView.xaml.cs">
<DependentUpon>VersionNumberView.xaml</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\BarLevelInputView.xaml"> <EmbeddedResource Include="$(MSBuildThisFileDirectory)View\BarLevelInputView.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator> <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)View\RunningProcessView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
</Project> </Project>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShareeSharedGuiLib.View.BarLevelView"> x:Class="ShareeSharedGuiLib.View.BarLevelView">
@ -8,6 +8,8 @@
<Image <Image
x:Name="BarLevelImage" x:Name="BarLevelImage"
WidthRequest="50" WidthRequest="50"
HeightRequest="30"
Aspect="AspectFit"
IsVisible="{Binding IsBatteryChargeLevelImageVisible}" IsVisible="{Binding IsBatteryChargeLevelImageVisible}"
Source="{Binding BatteryChargeLevelImageSourceString}"/> Source="{Binding BatteryChargeLevelImageSourceString}"/>
<!-- Text describing filling level batteries with 1...4 and 6..N bars --> <!-- Text describing filling level batteries with 1...4 and 6..N bars -->

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShareeSharedGuiLib.View.RunningProcessView">
<ContentView.Content>
<!--Grid for different Opacity values-->
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--Background White, half transparent-->
<Frame
Grid.Row="0"
Grid.RowSpan="2"
BackgroundColor="White"
Opacity=".75"
CornerRadius="10"/>
<!--Show spinner and info text-->
<!--Spinner-->
<ActivityIndicator
Grid.Row="0"
IsRunning="{Binding IsRunning}"
IsVisible="{Binding IsRunning}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
<!--Info text-->
<Label
Grid.Row="1"
Text="{Binding StatusInfoText}"
FontSize="Small"
HorizontalOptions="Center"
Padding="0,0,0,10"/>
</Grid>
</ContentView.Content>
</ContentView>

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 ShareeSharedGuiLib.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class RunningProcessView : ContentView
{
public RunningProcessView()
{
InitializeComponent();
}
}
}

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ShareeSharedGuiLib.View.VersionNumberView">
<ContentView.Content>
<StackLayout HorizontalOptions="Center"
Orientation="Horizontal"
Padding="0,0,0,10">
<Label
HorizontalOptions="End"
FontSize="12"
TextColor="DimGray"
Text="App Version"/>
<Label
HorizontalOptions="Start"
FontSize="12"
TextColor="DimGray"
x:Name="CurrentAppVersionNumber"/>
</StackLayout>
</ContentView.Content>
</ContentView>

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ShareeSharedGuiLib.View
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class VersionNumberView : ContentView
{
public VersionNumberView()
{
InitializeComponent();
CurrentAppVersionNumber.Text = TINK.Model.CurrentAppInfos.CurrentAppVersion;
}
}
}

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.338" android:versionCode="338"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="internalOnly" package="com.hauffware.sharee" android:versionName="3.0.339" android:versionCode="339">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" /> <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="30" />
<!-- Google Maps related permissions --> <!-- Google Maps related permissions -->
<!-- Permission to receive remote notifications from Google Play Services --> <!-- Permission to receive remote notifications from Google Play Services -->

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
@ -55,8 +55,8 @@
<key>CFBundleDisplayName</key> <key>CFBundleDisplayName</key>
<string>sharee.bike</string> <string>sharee.bike</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>338</string> <string>339</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>3.0.338</string> <string>3.0.339</string>
</dict> </dict>
</plist> </plist>

View file

@ -1,41 +1,57 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.BikesAtStation.BikesAtStationPage" x:Class="TINK.View.BikesAtStation.BikesAtStationPage"
xmlns:local_bike="clr-namespace:TINK.View.Bike" xmlns:local_bike="clr-namespace:TINK.View.Bike"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"> xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View">
<Shell.TitleView> <Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*"> <Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}" <Label Style="{StaticResource Label-Navbar}"
Text="{Binding Title}"/> Text="{Binding Title}"/>
</Grid> </Grid>
</Shell.TitleView> </Shell.TitleView>
<ContentPage.Resources> <ContentPage.Resources>
<ResourceDictionary> <ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/> <local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<Frame> <Frame>
<StackLayout
Orientation="Vertical"> <!--Grid for Bike(s) view and Running process in same row-->
<!-- Title bar stack layout--> <Grid>
<StackLayout <Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!--Bike(s) view-->
<StackLayout Grid.Row="0"
Orientation="Vertical"> Orientation="Vertical">
<!--Title-->
<Label <Label
HorizontalOptions="Center" HorizontalOptions="Center"
FontAttributes="Bold" FontAttributes="Bold"
TextColor="{DynamicResource primary-back-title-color}" TextColor="{DynamicResource primary-back-title-color}"
Text="{Binding StationDetailText}"/> Text="{Binding StationDetailText}"/>
<!--Line-->
<BoxView <BoxView
HeightRequest="1" HeightRequest="1"
Color="{DynamicResource primary-back-title-color}"/> Color="{DynamicResource primary-back-title-color}"/>
</StackLayout> </StackLayout>
<!-- Center stack layout -->
<StackLayout <!--Bike(s)-->
Orientation="Vertical"
VerticalOptions="CenterAndExpand">
<ListView <ListView
Grid.Row="1"
x:Name="BikesAtStationListView" x:Name="BikesAtStationListView"
SelectionMode="None" SelectionMode="None"
SelectedItem="{Binding SelectedBike}" SelectedItem="{Binding SelectedBike}"
@ -43,36 +59,22 @@
IsVisible="{Binding IsBikesListVisible}" IsVisible="{Binding IsBikesListVisible}"
HasUnevenRows="True" HasUnevenRows="True"
ItemTemplate="{StaticResource bikeTemplateSelector}"/> ItemTemplate="{StaticResource bikeTemplateSelector}"/>
<!--No Bikes-->
<Label <Label
Grid.Row="1"
IsVisible="{Binding IsNoBikesAtStationVisible}" IsVisible="{Binding IsNoBikesAtStationVisible}"
Text="{Binding NoBikesAtStationText}"/> Text="{Binding NoBikesAtStationText}"/>
</StackLayout>
<!-- Status bar stack layout--> <!-- Contact and Login at end of page-->
<StackLayout <StackLayout
Orientation="Vertical"> Orientation="Vertical"
<StackLayout Grid.Row="2">
Orientation="Horizontal">
<Label <!--Line-->
HeightRequest="24"
FontSize="Small"
Text="{Binding StatusInfoText}"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsRunning}"
IsVisible="{Binding IsRunning}"
HeightRequest="20"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End">
<ActivityIndicator.WidthRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="40" />
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
Android="#009899" iOS="#009899" WinPhone="#009899" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
<BoxView HeightRequest="1" Color="{DynamicResource primary-back-title-color}"/> <BoxView HeightRequest="1" Color="{DynamicResource primary-back-title-color}"/>
<!--Contact to operator-->
<Label <Label
TextType="Html" TextType="Html"
Text="{Binding ContactSupportHintText}"> Text="{Binding ContactSupportHintText}">
@ -80,6 +82,8 @@
<TapGestureRecognizer Command="{Binding ContactSupportClickedCommand}"/> <TapGestureRecognizer Command="{Binding ContactSupportClickedCommand}"/>
</Label.GestureRecognizers> </Label.GestureRecognizers>
</Label> </Label>
<!--Login required-->
<Label <Label
IsVisible="{Binding IsLoginRequiredHintVisible}" IsVisible="{Binding IsLoginRequiredHintVisible}"
TextType="Html" TextType="Html"
@ -89,7 +93,15 @@
</Label.GestureRecognizers> </Label.GestureRecognizers>
</Label> </Label>
</StackLayout> </StackLayout>
</StackLayout>
<!--While process is running-->
<sharedGui:RunningProcessView
IsVisible="{Binding IsRunning}"
Grid.Row="1"/>
</Grid>
</Frame> </Frame>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View file

@ -1,33 +1,43 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib" xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.CopriWebView.ManageAccountPage"> x:Class="TINK.View.CopriWebView.ManageAccountPage">
<Shell.TitleView> <Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*"> <Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}" <Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MessageAccountPageManagePersonalData}"/> Text="{x:Static resources:AppResources.MessageAccountPageManagePersonalData}"/>
</Grid> </Grid>
</Shell.TitleView> </Shell.TitleView>
<Shell.BackButtonBehavior> <Shell.BackButtonBehavior>
<!--<BackButtonBehavior IconOverride="x_icon.png" />-->
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" /> <BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
</Shell.BackButtonBehavior> </Shell.BackButtonBehavior>
<ContentPage.Content> <ContentPage.Content>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<WebView x:Name="ManageAccount" <WebView
Grid.Row="0"
x:Name="ManageAccount"
HeightRequest="1400" HeightRequest="1400"
WidthRequest="1000" WidthRequest="1000"
Source="{Binding Uri}" /> Source="{Binding Uri}" />
<ActivityIndicator
<ActivityIndicator Grid.Row="0"
x:Name="ActivityIndicatorLoading" x:Name="ActivityIndicatorLoading"
HeightRequest="100" Scale="2"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"/> HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid> </Grid>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib" xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
@ -21,11 +21,13 @@
HeightRequest="1400" HeightRequest="1400"
WidthRequest="1000" WidthRequest="1000"
Source="{Binding Uri}" /> Source="{Binding Uri}" />
<ActivityIndicator
<ActivityIndicator Grid.Row="0"
x:Name="ActivityIndicatorLoading" x:Name="ActivityIndicatorLoading"
HeightRequest="100" Scale="2"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"/> HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid> </Grid>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib" xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
@ -21,11 +21,13 @@
HeightRequest="1400" HeightRequest="1400"
WidthRequest="1000" WidthRequest="1000"
Source="{Binding Uri}" /> Source="{Binding Uri}" />
<ActivityIndicator
<ActivityIndicator Grid.Row="0"
x:Name="ActivityIndicatorLoading" x:Name="ActivityIndicatorLoading"
HeightRequest="100" Scale="2"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"/> HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
</Grid> </Grid>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View file

@ -1,36 +1,50 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.FindBike.FindBikePage" x:Class="TINK.View.FindBike.FindBikePage"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib" xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:local_bike="clr-namespace:TINK.View.Bike"> xmlns:local_bike="clr-namespace:TINK.View.Bike"
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View">
<Shell.TitleView> <Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*"> <Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}" <Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingFindBike}"/> Text="{x:Static resources:AppResources.MarkingFindBike}"/>
</Grid> </Grid>
</Shell.TitleView> </Shell.TitleView>
<ContentPage.Resources> <ContentPage.Resources>
<ResourceDictionary> <ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/> <local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<Frame> <Frame>
<StackLayout>
<!--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 <Entry
Placeholder="Fahrrad-Nummer bitte hier eingeben" Placeholder="{x:Static resources:AppResources.PlaceholderFindBike}"
IsVisible="{Binding IsSelectBikeVisible}" IsVisible="{Binding IsSelectBikeVisible}"
MaxLength="10" MaxLength="10"
CursorPosition="0" CursorPosition="0"
Text="{Binding BikeIdUserInput}"> Text="{Binding BikeIdUserInput}"/>
</Entry>
<Button <Button
Text="Rad Wählen" Text="{x:Static resources:AppResources.MarkingFindBike}"
IsEnabled="{Binding IsSelectBikeEnabled}" IsEnabled="{Binding IsSelectBikeEnabled}"
IsVisible="{Binding IsSelectBikeVisible}" IsVisible="{Binding IsSelectBikeVisible}"
Command="{Binding OnSelectBikeRequest}"> Command="{Binding OnSelectBikeRequest}"/>
</Button>
<ListView <ListView
x:Name="FindBikeListView" x:Name="FindBikeListView"
SelectionMode="None" SelectionMode="None"
@ -39,30 +53,16 @@
IsVisible="{Binding IsBikesListVisible}" IsVisible="{Binding IsBikesListVisible}"
HasUnevenRows="True" HasUnevenRows="True"
ItemTemplate="{StaticResource bikeTemplateSelector}"/> ItemTemplate="{StaticResource bikeTemplateSelector}"/>
<StackLayout
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
HeightRequest="20"
Text="{Binding StatusInfoText}"
FontSize="Small"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsRunning}"
IsVisible="{Binding IsRunning}"
HeightRequest="20"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End">
<ActivityIndicator.WidthRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="40" />
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
Android="#009899" iOS="#009899" WinPhone="#009899" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
</StackLayout> </StackLayout>
<!--While process is running-->
<sharedGui:RunningProcessView
Grid.Row="0"
IsVisible="{Binding IsRunning}"/>
</Grid>
</Frame> </Frame>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View file

@ -6,18 +6,22 @@
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib" xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Map.MapPage" x:Class="TINK.View.Map.MapPage"
BackgroundColor="{DynamicResource Key=primary-back-title-color}"> BackgroundColor="{DynamicResource Key=primary-back-title-color}">
<Shell.TitleView > <Shell.TitleView >
<Grid ColumnDefinitions="Auto, 1*"> <Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}" <Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingMapPage}"/> Text="{x:Static resources:AppResources.MarkingMapPage}"/>
</Grid> </Grid>
</Shell.TitleView> </Shell.TitleView>
<!--Grid for Map with Buttons and Running process-->
<Grid <Grid
RowDefinitions="3,46,1*,33" RowDefinitions="3,46,1*,Auto"
ColumnDefinitions="1*,Auto,1*" ColumnDefinitions="1*,Auto,1*"
IsEnabled="{Binding IsMapPageEnabled}" IsEnabled="{Binding IsMapPageEnabled}"
VerticalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
>
<!--Map-->
<maps:Map <maps:Map
Grid.RowSpan="3" Grid.RowSpan="3"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
@ -31,6 +35,8 @@
<bindings:PinClickedToCommandBehavior Command="{Binding PinClickedCommand}"/> <bindings:PinClickedToCommandBehavior Command="{Binding PinClickedCommand}"/>
</maps:Map.Behaviors> </maps:Map.Behaviors>
</maps:Map> </maps:Map>
<!--Buttons for choosing bike type-->
<Frame <Frame
CornerRadius="13" CornerRadius="13"
Grid.Row="1" Grid.Row="1"
@ -38,7 +44,8 @@
Margin="0" Margin="0"
Padding="0" Padding="0"
BackgroundColor="{DynamicResource secondary-back-title-color}"> BackgroundColor="{DynamicResource secondary-back-title-color}">
<StackLayout Orientation="Horizontal" <StackLayout
Orientation="Horizontal"
Margin="0" Margin="0"
Padding="0"> Padding="0">
<Button <Button
@ -81,32 +88,29 @@
</Button> </Button>
</StackLayout> </StackLayout>
</Frame> </Frame>
<StackLayout
<!--While process is running-->
<!--Spinner-->
<ActivityIndicator
Grid.RowSpan="4"
Grid.ColumnSpan="3"
IsRunning="{Binding IsRunning}"
IsVisible="{Binding IsRunning}"
Scale="2"
VerticalOptions="CenterAndExpand"
HorizontalOptions="CenterAndExpand"
Color="{x:DynamicResource primary-back-title-color}"/>
<!--Info text-->
<Label
Grid.Row="3" Grid.Row="3"
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
Margin="6,3,6,6"
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
HeightRequest="24"
FontSize="Small"
Text="{Binding StatusInfoText}" Text="{Binding StatusInfoText}"
TextColor="White" TextColor="White"
VerticalOptions="Center" FontSize="Small"
HorizontalOptions="FillAndExpand"/> HorizontalOptions="Center"
<ActivityIndicator IsRunning="{Binding IsRunning}" Padding="0,0,0,10"/>
IsVisible="{Binding IsRunning}"
HeightRequest="20"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End">
<ActivityIndicator.WidthRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="40" />
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
Android="White" iOS="White" WinPhone="White"/>
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
</Grid> </Grid>
</ContentPage> </ContentPage>

View file

@ -1,28 +1,41 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" <ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.MyBikes.MyBikesPage" x:Class="TINK.View.MyBikes.MyBikesPage"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib" xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
xmlns:local_bike="clr-namespace:TINK.View.Bike"> xmlns:local_bike="clr-namespace:TINK.View.Bike">
<Shell.TitleView> <Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*"> <Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}" <Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingMyBikes}"/> Text="{x:Static resources:AppResources.MarkingMyBikes}"/>
</Grid> </Grid>
</Shell.TitleView> </Shell.TitleView>
<ContentPage.Resources> <ContentPage.Resources>
<ResourceDictionary> <ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/> <local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<ContentPage.Content> <ContentPage.Content>
<Frame> <Frame>
<StackLayout
Orientation="Vertical"> <!--Grid for Bike(s) view and Running process in same row-->
<!-- Center stack layout --> <Grid>
<StackLayout <Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--Bike(s) view-->
<StackLayout Grid.Row="0"
VerticalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"
Orientation="Vertical"> Orientation="Vertical">
<!--Bike(s)-->
<ListView <ListView
x:Name="MyBikesListView" x:Name="MyBikesListView"
SelectionMode="None" SelectionMode="None"
@ -31,34 +44,22 @@
IsVisible="{Binding IsBikesListVisible}" IsVisible="{Binding IsBikesListVisible}"
HasUnevenRows="True" HasUnevenRows="True"
ItemTemplate="{StaticResource bikeTemplateSelector}"/> ItemTemplate="{StaticResource bikeTemplateSelector}"/>
<!--No Bikes-->
<Label <Label
IsVisible="{Binding IsNoBikesOccupiedVisible}" IsVisible="{Binding IsNoBikesOccupiedVisible}"
Text="{Binding NoBikesOccupiedText}"/> Text="{Binding NoBikesOccupiedText}"/>
</StackLayout> </StackLayout>
<!-- Status bar stack layout-->
<StackLayout <!--While process is running-->
Orientation="Horizontal"> <sharedGui:RunningProcessView
<Label Grid.Row="0"
HeightRequest="24" IsVisible="{Binding IsRunning}"/>
Text="{Binding StatusInfoText}"
FontSize="Small" </Grid>
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsRunning}"
IsVisible="{Binding IsRunning}"
HeightRequest="20"
VerticalOptions="CenterAndExpand"
HorizontalOptions="End">
<ActivityIndicator.WidthRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="40" Android="40" WinPhone="40" />
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
Android="#009899" iOS="#009899" WinPhone="#009899" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
</StackLayout>
</Frame> </Frame>
</ContentPage.Content> </ContentPage.Content>
</ContentPage> </ContentPage>

View file

@ -11,6 +11,7 @@
xmlns:contact="clr-namespace:TINK.View.Contact" xmlns:contact="clr-namespace:TINK.View.Contact"
xmlns:info="clr-namespace:TINK.View.Info" xmlns:info="clr-namespace:TINK.View.Info"
xmlns:header="clr-namespace:TINK.View.RootShell" xmlns:header="clr-namespace:TINK.View.RootShell"
xmlns:version="clr-namespace:ShareeSharedGuiLib.View"
BackgroundColor="{DynamicResource Key=primary-back-title-color}" BackgroundColor="{DynamicResource Key=primary-back-title-color}"
Title="Shell" Title="Shell"
x:Class="TINK.View.RootShell.AppShell"> x:Class="TINK.View.RootShell.AppShell">
@ -107,4 +108,8 @@
</ShellContent.FlyoutIcon> </ShellContent.FlyoutIcon>
</ShellContent> </ShellContent>
</FlyoutItem> </FlyoutItem>
<Shell.FlyoutFooter>
<version:VersionNumberView/>
</Shell.FlyoutFooter>
</Shell> </Shell>

View file

@ -0,0 +1,9 @@
using Xamarin.Essentials;
namespace TINK.Model
{
public static class CurrentAppInfos
{
public static string CurrentAppVersion => VersionTracking.CurrentVersion;
}
}

View file

@ -1,4 +1,4 @@
using Xamarin.Essentials; using Xamarin.Essentials;
namespace TINK.Model.Device namespace TINK.Model.Device
{ {
@ -14,6 +14,7 @@ namespace TINK.Model.Device
/// <summary> Device Model (SMG-950U, iPhone10,6). </summary> /// <summary> Device Model (SMG-950U, iPhone10,6). </summary>
string Model { get; } string Model { get; }
/// <summary> Operation system. </summary>
DevicePlatform Platform { get; } DevicePlatform Platform { get; }
/// <summary> Operating System Version Number (7.0) as text</summary> /// <summary> Operating System Version Number (7.0) as text</summary>

View file

@ -0,0 +1,16 @@
using System;
using Serilog;
using TINK.Model.Device;
namespace TINK.Model.Logging
{
public class AppAndEnvironmentInfo
{
public void LogHeader(ISmartDevice device, AppFlavor appFlavor, Version appVersion)
{
Log.ForContext<AppAndEnvironmentInfo>().Information($"App: {appFlavor.GetDisplayName()}, version {appVersion}");
Log.ForContext<AppAndEnvironmentInfo>().Information($"OS: {device.Platform}, version: {device.VersionText}");
Log.ForContext<AppAndEnvironmentInfo>().Information($"Device: {device.Model}, manufacturer: {device.Manufacturer}");
}
}
}

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Runtime.Serialization; using System.Runtime.Serialization;
using System.Threading; using System.Threading;
@ -190,6 +190,9 @@ namespace TINK.Model
Flavor = flavor; Flavor = flavor;
// Log application and environment information.
new AppAndEnvironmentInfo().LogHeader(device, flavor, currentVersion);
var locksServices = locksService != null var locksServices = locksService != null
? new HashSet<ILocksService> { locksService } ? new HashSet<ILocksService> { locksService }
: new HashSet<ILocksService> { : new HashSet<ILocksService> {
@ -440,15 +443,50 @@ namespace TINK.Model
LoggingLevelSwitch levelSwitch, LoggingLevelSwitch levelSwitch,
string logFilePath) string logFilePath)
{ {
bool LogToFileFilter(LogEvent e)
{
if (e.Level >= levelSwitch.MinimumLevel)
{
// If level is above global logging level do log.
return true;
}
if (!e.Properties.ContainsKey(Constants.SourceContextPropertyName))
{
// Do not log if source context is not available.
return false;
}
var sourceContex = e.Properties[Constants.SourceContextPropertyName].ToString();
if ((e.Level == LogEventLevel.Information) &&
(sourceContex.Contains(typeof(AppAndEnvironmentInfo).Namespace) /* Log App and enviroment info. */
|| sourceContex.Contains(typeof(ViewModel.Bikes.Bike.BluetoothLock.RequestHandler.Base).Namespace /* Log info-level messages to provide context for bluetooth log. */ )))
{
return true;
}
if (e.Level >= LogEventLevel.Debug
&& sourceContex.Contains(typeof(LockItBase).Namespace /*Scanning, connect and management functionality */))
{
return true;
}
return false;
}
Log.Logger = new LoggerConfiguration() Log.Logger = new LoggerConfiguration()
.MinimumLevel.ControlledBy(levelSwitch) .MinimumLevel.Verbose()
.MinimumLevel.Override("TINK.Services.BluetoothLock.BLE", LogEventLevel.Debug) /* Scanning, connect and management functionality */ .WriteTo.Logger(consoleLoggerConfig => consoleLoggerConfig
.MinimumLevel.Override("TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler", LogEventLevel.Information) /* Provides use case context */ .MinimumLevel.Information()
.WriteTo.Debug() .WriteTo.Debug()
)
.WriteTo.Logger(fileLoggerConfig => fileLoggerConfig
.Filter.ByIncludingOnly(e => LogToFileFilter(e))
.WriteTo.File(logFilePath, Logging.RollingInterval.Session) .WriteTo.File(logFilePath, Logging.RollingInterval.Session)
.WriteTo.Logger(lg => lg )
.MinimumLevel.ControlledBy(new LoggingLevelSwitch(LogEventLevel.Debug)) .WriteTo.Logger(copriLoggerConfig => copriLoggerConfig
.Filter.ByIncludingOnly(Matching.FromSource("TINK.Services.BluetoothLock.BLE")) .MinimumLevel.Debug()
.Filter.ByIncludingOnly(Matching.FromSource(typeof(LockItBase/*Scanning, connect and management functionality */).Namespace))
.WriteTo.MemoryQueueSink() .WriteTo.MemoryQueueSink()
) )
.CreateLogger(); .CreateLogger();

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using TINK.MultilingualResources; using TINK.MultilingualResources;
using Xamarin.Essentials; using Xamarin.Essentials;
@ -584,6 +584,16 @@ namespace TINK.Model
new Version(3, 0, 338), new Version(3, 0, 338),
AppResources.ChangeLog3_0_338_SB, AppResources.ChangeLog3_0_338_SB,
new List<AppFlavor> { AppFlavor.ShareeBike } new List<AppFlavor> { AppFlavor.ShareeBike }
},
{
new Version(3, 0, 339),
AppResources.ChangeLog3_0_339_SB_LB,
new List<AppFlavor> { AppFlavor.LastenradBayern, AppFlavor.ShareeBike }
},
{
new Version(3, 0, 339),
AppResources.ChangeLog3_0_339_MK,
new List<AppFlavor> { AppFlavor.MeinKonrad }
} }
}; };

View file

@ -1210,6 +1210,26 @@ namespace TINK.MultilingualResources {
} }
} }
/// <summary>
/// Looks up a localized string similar to The cargo bikes from the suburbs now show their home station in their name. These bikes must be returned there!
///
///You can now see at a glance which app version you have installed: in the menu at the very bottom. Please update the app regularly to be up to date in functionality and design!.
/// </summary>
public static string ChangeLog3_0_339_MK {
get {
return ResourceManager.GetString("ChangeLog3_0_339_MK", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You can now see at a glance which app version you have installed: in the menu at the very bottom. Please update the app regularly to be up to date in functionality and design!.
/// </summary>
public static string ChangeLog3_0_339_SB_LB {
get {
return ResourceManager.GetString("ChangeLog3_0_339_SB_LB", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Failed to query available bikes.. /// Looks up a localized string similar to Failed to query available bikes..
/// </summary> /// </summary>
@ -2636,6 +2656,15 @@ namespace TINK.MultilingualResources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Enter bike number here.
/// </summary>
public static string PlaceholderFindBike {
get {
return ResourceManager.GetString("PlaceholderFindBike", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to No. /// Looks up a localized string similar to No.
/// </summary> /// </summary>

View file

@ -1020,4 +1020,15 @@ Außerdem: Kleine Grafiken lassen auf einen Blick erkennen um was für einen Rad
<data name="QuestionSupportmailTitle" xml:space="preserve"> <data name="QuestionSupportmailTitle" xml:space="preserve">
<value>Einwilligung</value> <value>Einwilligung</value>
</data> </data>
<data name="PlaceholderFindBike" xml:space="preserve">
<value>Fahrrad-Nummer hier eingeben</value>
</data>
<data name="ChangeLog3_0_339_MK" xml:space="preserve">
<value>Die Lastenräder aus den Vororten zeigen nun ihre Heimatstation im Namen an. Diese Räder müssen dort wieder abgeben werden!
Sie können nun auf einen Blick sehen, welche App-Version Sie installiert haben: im Menü ganz unten. Bitte aktualisieren Sie die App regelmäßig, um in Funktionalität und Design auf dem neuesten Stand zu sein!</value>
</data>
<data name="ChangeLog3_0_339_SB_LB" xml:space="preserve">
<value>Sie können nun auf einen Blick sehen, welche App-Version Sie installiert haben: im Menü ganz unten. Bitte aktualisieren Sie die App regelmäßig, um in Funktionalität und Design auf dem neuesten Stand zu sein!</value>
</data>
</root> </root>

View file

@ -1112,4 +1112,15 @@ In addition: Small graphics let you see at a glance what type of bike it is.</va
<data name="QuestionSupportmailTitle" xml:space="preserve"> <data name="QuestionSupportmailTitle" xml:space="preserve">
<value>Consent</value> <value>Consent</value>
</data> </data>
<data name="PlaceholderFindBike" xml:space="preserve">
<value>Enter bike number here</value>
</data>
<data name="ChangeLog3_0_339_MK" xml:space="preserve">
<value>The cargo bikes from the suburbs now show their home station in their name. These bikes must be returned there!
You can now see at a glance which app version you have installed: in the menu at the very bottom. Please update the app regularly to be up to date in functionality and design!</value>
</data>
<data name="ChangeLog3_0_339_SB_LB" xml:space="preserve">
<value>You can now see at a glance which app version you have installed: in the menu at the very bottom. Please update the app regularly to be up to date in functionality and design!</value>
</data>
</root> </root>

View file

@ -1384,6 +1384,22 @@ Außerdem: Kleine Grafiken lassen auf einen Blick erkennen um was für einen Rad
<source>Consent</source> <source>Consent</source>
<target state="translated">Einwilligung</target> <target state="translated">Einwilligung</target>
</trans-unit> </trans-unit>
<trans-unit id="PlaceholderFindBike" translate="yes" xml:space="preserve">
<source>Enter bike number here</source>
<target state="translated">Fahrrad-Nummer hier eingeben</target>
</trans-unit>
<trans-unit id="ChangeLog3_0_339_MK" translate="yes" xml:space="preserve">
<source>The cargo bikes from the suburbs now show their home station in their name. These bikes must be returned there!
You can now see at a glance which app version you have installed: in the menu at the very bottom. Please update the app regularly to be up to date in functionality and design!</source>
<target state="translated">Die Lastenräder aus den Vororten zeigen nun ihre Heimatstation im Namen an. Diese Räder müssen dort wieder abgeben werden!
Sie können nun auf einen Blick sehen, welche App-Version Sie installiert haben: im Menü ganz unten. Bitte aktualisieren Sie die App regelmäßig, um in Funktionalität und Design auf dem neuesten Stand zu sein!</target>
</trans-unit>
<trans-unit id="ChangeLog3_0_339_SB_LB" translate="yes" xml:space="preserve">
<source>You can now see at a glance which app version you have installed: in the menu at the very bottom. Please update the app regularly to be up to date in functionality and design!</source>
<target state="translated">Sie können nun auf einen Blick sehen, welche App-Version Sie installiert haben: im Menü ganz unten. Bitte aktualisieren Sie die App regelmäßig, um in Funktionalität und Design auf dem neuesten Stand zu sein!</target>
</trans-unit>
</group> </group>
</body> </body>
</file> </file>

View file

@ -1,11 +1,13 @@
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace TINK.Repository.Exception namespace TINK.Repository.Exception
{ {
public class NotAtStationException : InvalidResponseException public class NotAtStationException : InvalidResponseException
{ {
/// <summary> COPRI response status regular expression. </summary> public const string RETURNBIKE_FAILURE_STATUS_MESSAGE_CODE = "FAILURE 2178:";
public const string RETURNBIKE_FAILURE_STATUS_MESSAGE_UPPERCASE = "(FAILURE 2178: BIKE [0-9]+ OUT OF GEO FENCING\\. )([0-9]+)( METER DISTANCE TO NEXT STATION )([0-9]+)";
/// <summary> COPRI response status regular expression to extract detail information. </summary>
public const string RETURNBIKE_FAILURE_STATUS_MESSAGE_UPPERCASE = "(BIKE [A-Za-z0-9_]+ OUT OF GEO FENCING\\. )([0-9]+)( METER DISTANCE TO NEXT STATION )([A-Za-z0-9_]+)";
/// <summary> Prevents invalid use of exception. </summary> /// <summary> Prevents invalid use of exception. </summary>
private NotAtStationException() : base(typeof(NotAtStationException).Name) private NotAtStationException() : base(typeof(NotAtStationException).Name)
@ -15,25 +17,36 @@ namespace TINK.Repository.Exception
public static bool IsNotAtStation(string responseState, out NotAtStationException exception) public static bool IsNotAtStation(string responseState, out NotAtStationException exception)
{ {
// Check if there are too many bikes requested/ booked. // Check if there are too many bikes requested/ booked.
var match = Regex.Match( var response = responseState.Trim().ToUpper();
responseState.ToUpper(),
RETURNBIKE_FAILURE_STATUS_MESSAGE_UPPERCASE); if (!response.StartsWith(RETURNBIKE_FAILURE_STATUS_MESSAGE_CODE))
if (match.Groups.Count != 5
|| !int.TryParse(match.Groups[2].ToString(), out int meters)
|| !int.TryParse(match.Groups[4].ToString(), out int stationNr))
{ {
exception = null; exception = null;
return false; return false;
} }
exception = new NotAtStationException { Distance = meters, StationNr = stationNr }; var match = Regex.Match(
responseState.ToUpper(),
RETURNBIKE_FAILURE_STATUS_MESSAGE_UPPERCASE);
if (match.Groups.Count != 5
|| !int.TryParse(match.Groups[2].ToString(), out int meters))
{
exception = new NotAtStationException();
return true;
}
exception = new NotAtStationException {
Distance = meters,
StationNr = match.Groups[4].ToString()
};
return true; return true;
} }
/// <summary> Holds the maximum count of bikes allowed to reserve/ book.</summary> /// <summary> Holds the maximum count of bikes allowed to reserve/ book.</summary>
public int Distance { get; private set; } public int? Distance { get; private set; } = null;
/// <summary> Holds the maximum count of bikes allowed to reserve/ book.</summary> /// <summary> Holds the maximum count of bikes allowed to reserve/ book.</summary>
public int StationNr { get; private set; } public string StationNr { get; private set; } = string.Empty;
} }
} }

View file

@ -63,6 +63,14 @@
<ProjectReference Include="..\LockItBLE\LockItBLE.csproj" /> <ProjectReference Include="..\LockItBLE\LockItBLE.csproj" />
<ProjectReference Include="..\LockItShared\LockItShared.csproj" /> <ProjectReference Include="..\LockItShared\LockItShared.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Reference Include="Mono.Android">
<HintPath>..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v11.0\Mono.Android.dll</HintPath>
</Reference>
<Reference Include="Xamarin.iOS">
<HintPath>..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Xamarin.iOS.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Update="MultilingualResources\AppResources.Designer.cs"> <Compile Update="MultilingualResources\AppResources.Designer.cs">
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>

View file

@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms" <ResourceDictionary xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.Themes.ShareeBike"> x:Class="TINK.Themes.ShareeBike">
<!--Main color-->
<Color x:Key="primary-back-title-color">#009899</Color> <Color x:Key="primary-back-title-color">#009899</Color>
<!--Primary Button-->
<Style TargetType="Button"> <Style TargetType="Button">
<Setter Property="WidthRequest" Value="400" /> <Setter Property="WidthRequest" Value="400" />
<Setter Property="HorizontalOptions" Value="Center" /> <Setter Property="HorizontalOptions" Value="Center" />
@ -27,6 +29,8 @@
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<!--Secondary Button-->
<Style x:Key="SecondaryButton" TargetType="Button"> <Style x:Key="SecondaryButton" TargetType="Button">
<Setter Property="WidthRequest" Value="400" /> <Setter Property="WidthRequest" Value="400" />
<Setter Property="HorizontalOptions" Value="Center" /> <Setter Property="HorizontalOptions" Value="Center" />
@ -50,6 +54,7 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<!--Switch-->
<Style TargetType="Switch"> <Style TargetType="Switch">
<Style.Triggers> <Style.Triggers>
<Trigger TargetType="Switch" <Trigger TargetType="Switch"
@ -64,17 +69,24 @@
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<!--Slider-->
<Style TargetType="Slider"> <Style TargetType="Slider">
<Setter Property="ThumbColor" Value="{DynamicResource Key=primary-back-title-color}"/> <Setter Property="ThumbColor" Value="{DynamicResource Key=primary-back-title-color}"/>
<Setter Property="Background" Value="LightGray"/> <Setter Property="Background" Value="LightGray"/>
</Style> </Style>
<!--Label-->
<Style TargetType="Label"> <Style TargetType="Label">
<Setter Property="FontSize" Value="Default"/> <Setter Property="FontSize" Value="Default"/>
</Style> </Style>
<!--Flyout Item-->
<Style TargetType="FlyoutItem"> <Style TargetType="FlyoutItem">
<Setter Property="Shell.BackgroundColor" Value="{DynamicResource Key=primary-back-title-color}" /> <Setter Property="Shell.BackgroundColor" Value="{DynamicResource Key=primary-back-title-color}" />
</Style> </Style>
<!--Navbar-->
<Style x:Key="Label-Navbar" TargetType="Label"> <Style x:Key="Label-Navbar" TargetType="Label">
<Setter Property="FontSize" Value="20"/> <Setter Property="FontSize" Value="20"/>
<!--<Setter Property="TextTransform" Value="Uppercase"/>--> <!--<Setter Property="TextTransform" Value="Uppercase"/>-->

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -174,7 +174,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
if (exception is WebConnectFailureException) if (exception is WebConnectFailureException)
{ {
// Copri server is not reachable. // Copri server is not reachable.
Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returing failed (Copri server not reachable).", SelectedBike); Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returning failed (Copri server not reachable).", SelectedBike);
await ViewService.DisplayAdvancedAlert( await ViewService.DisplayAdvancedAlert(
AppResources.ErrorReturnBikeNoWebTitle, AppResources.ErrorReturnBikeNoWebTitle,
@ -185,7 +185,10 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
else if (exception is NotAtStationException notAtStationException) else if (exception is NotAtStationException notAtStationException)
{ {
// COPRI returned an error. // COPRI returned an error.
Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returning failed. COPRI returned an not at station error.", SelectedBike); Log.ForContext<BookedClosed>().Information(
"User selected booked bike {bike} but returning failed. COPRI returned out of GEO fencing error. Postion send to COPRI {@position}.",
SelectedBike,
currentLocationDto);
await ViewService.DisplayAlert( await ViewService.DisplayAlert(
AppResources.ErrorReturnBikeTitle, AppResources.ErrorReturnBikeTitle,
@ -195,7 +198,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
else if (exception is NoGPSDataException) else if (exception is NoGPSDataException)
{ {
// COPRI returned an error. // COPRI returned an error.
Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returing failed. COPRI returned an no GPS- data error.", SelectedBike); Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returning failed. COPRI returned an no GPS- data error.", SelectedBike);
await ViewService.DisplayAlert( await ViewService.DisplayAlert(
AppResources.ErrorReturnBikeTitle, AppResources.ErrorReturnBikeTitle,
@ -205,7 +208,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
else if (exception is ResponseException copriException) else if (exception is ResponseException copriException)
{ {
// COPRI returned an error. // COPRI returned an error.
Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returing failed. COPRI returned an error.", SelectedBike); Log.ForContext<BookedClosed>().Information("User selected booked bike {bike} but returning failed. COPRI returned an error.", SelectedBike);
await ViewService.DisplayAdvancedAlert( await ViewService.DisplayAdvancedAlert(
"Statusfehler beim Zurückgeben des Rads!", "Statusfehler beim Zurückgeben des Rads!",

View file

@ -1,4 +1,4 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -145,7 +145,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
if (exception is WebConnectFailureException) if (exception is WebConnectFailureException)
{ {
// Copri server is not reachable. // Copri server is not reachable.
Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returing failed (Copri server not reachable).", SelectedBike); Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returning failed (Copri server not reachable).", SelectedBike);
await ViewService.DisplayAdvancedAlert( await ViewService.DisplayAdvancedAlert(
AppResources.ErrorReturnBikeNoWebTitle, AppResources.ErrorReturnBikeNoWebTitle,
@ -343,12 +343,11 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
IsConnected = IsConnectedDelegate(); IsConnected = IsConnectedDelegate();
var feedBackUri = SelectedBike?.OperatorUri; var feedBackUri = SelectedBike?.OperatorUri;
LocationDto currentLocationDto = null;
BookingFinishedModel bookingFinished; BookingFinishedModel bookingFinished;
try try
{ {
bookingFinished = await ConnectorFactory(IsConnected).Command.DoReturn( currentLocationDto = currentLocation != null
SelectedBike,
currentLocation != null
? new LocationDto.Builder ? new LocationDto.Builder
{ {
Latitude = currentLocation.Latitude, Latitude = currentLocation.Latitude,
@ -356,7 +355,11 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
Accuracy = currentLocation.Accuracy ?? double.NaN, Accuracy = currentLocation.Accuracy ?? double.NaN,
Age = timeStamp.Subtract(currentLocation.Timestamp.DateTime), Age = timeStamp.Subtract(currentLocation.Timestamp.DateTime),
}.Build() }.Build()
: null, : null;
bookingFinished = await ConnectorFactory(IsConnected).Command.DoReturn(
SelectedBike,
currentLocationDto,
SmartDevice); SmartDevice);
// If canceling bike succedes remove bike because it is not ready to be booked again // If canceling bike succedes remove bike because it is not ready to be booked again
IsRemoveBikeRequired = true; IsRemoveBikeRequired = true;
@ -367,7 +370,8 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
if (exception is WebConnectFailureException) if (exception is WebConnectFailureException)
{ {
// Copri server is not reachable. // Copri server is not reachable.
Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returing failed (Copri server not reachable).", SelectedBike); Log.ForContext<BookedOpen>().Information(
"User selected booked bike {bike} but returning failed (Copri server not reachable).", SelectedBike);
await ViewService.DisplayAdvancedAlert( await ViewService.DisplayAdvancedAlert(
AppResources.ErrorReturnBikeNoWebTitle, AppResources.ErrorReturnBikeNoWebTitle,
@ -378,7 +382,10 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
else if (exception is NotAtStationException notAtStationException) else if (exception is NotAtStationException notAtStationException)
{ {
// COPRI returned an error. // COPRI returned an error.
Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returing failed. COPRI returned an error.", SelectedBike); Log.ForContext<BookedOpen>().Information(
"User selected booked bike {bike} but returning failed. COPRI returned out of GEO fencing error. Postion send to COPRI {@position}.",
SelectedBike,
currentLocationDto);
await ViewService.DisplayAlert( await ViewService.DisplayAlert(
AppResources.ErrorReturnBikeTitle, AppResources.ErrorReturnBikeTitle,
@ -388,7 +395,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
else if (exception is NoGPSDataException) else if (exception is NoGPSDataException)
{ {
// COPRI returned an error. // COPRI returned an error.
Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returing failed. COPRI returned an no GPS- data error.", SelectedBike); Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returning failed. COPRI returned an no GPS- data error.", SelectedBike);
await ViewService.DisplayAlert( await ViewService.DisplayAlert(
AppResources.ErrorReturnBikeTitle, AppResources.ErrorReturnBikeTitle,
@ -398,7 +405,7 @@ namespace TINK.ViewModel.Bikes.Bike.BluetoothLock.RequestHandler
else if (exception is ResponseException copriException) else if (exception is ResponseException copriException)
{ {
// Copri server is not reachable. // Copri server is not reachable.
Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returing failed. COPRI returned an error.", SelectedBike); Log.ForContext<BookedOpen>().Information("User selected booked bike {bike} but returning failed. COPRI returned an error.", SelectedBike);
await ViewService.DisplayAdvancedAlert( await ViewService.DisplayAdvancedAlert(
"Statusfehler beim Zurückgeben des Rads!", "Statusfehler beim Zurückgeben des Rads!",

View file

@ -1,4 +1,4 @@
using TINK.Model.Device; using TINK.Model.Device;
using Xamarin.Essentials; using Xamarin.Essentials;
namespace TestFramework.Model.Device namespace TestFramework.Model.Device
@ -10,13 +10,13 @@ namespace TestFramework.Model.Device
/// </summary> /// </summary>
private string m_strDeviceId = "522c6ff6886198fd"; private string m_strDeviceId = "522c6ff6886198fd";
public string Manufacturer => throw new System.NotImplementedException(); public string Manufacturer => "Faiphone";
public string Model => throw new System.NotImplementedException(); public string Model => "987";
public DevicePlatform Platform => DevicePlatform.UWP; public DevicePlatform Platform => DevicePlatform.UWP;
public string VersionText => throw new System.NotImplementedException(); public string VersionText => "17.11";
/// <summary> /// <summary>
/// Constructs a device mock object setting device id to default value. /// Constructs a device mock object setting device id to default value.

View file

@ -0,0 +1,71 @@
using NUnit.Framework;
using TINK.Repository.Exception;
namespace TestTINKLib.Fixtures.ObjectTests.Repository.Exception
{
[TestFixture]
public class TestNotAtStationException
{
[Test]
public void TestIsNotAtStationNumericBikeAndStationId()
{
const string responseText = "Failure 2178: bike 1545 out of GEO fencing. 15986 meter distance to next station 105. OK: bike 1545 locked confirmed";
NotAtStationException exception = null;
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
Is.EqualTo(true));
Assert.That(() => exception.StationNr,
Is.EqualTo("105"));
Assert.That(() => exception.Distance,
Is.EqualTo(15986));
}
[Test]
public void TestIsNotAtStationAlphanumBikeAndStationId()
{
const string responseText = "Failure 2178: bike KN247 out of GEO fencing. 764 meter distance to next station KN20 . OK: bike KN247 locked confirmed";
NotAtStationException exception = null;
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
Is.EqualTo(true));
Assert.That(() => exception.StationNr,
Is.EqualTo("KN20"));
Assert.That(() => exception.Distance,
Is.EqualTo(764));
}
[Test]
public void TestIsNotAtStationUnexpected()
{
const string responseText = "Failure 2178: Message from COPRI does not match expectations.";
NotAtStationException exception = null;
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
Is.EqualTo(true));
Assert.That(() => exception.StationNr,
Is.EqualTo(string.Empty));
Assert.That(() => exception.Distance,
Is.Null);
}
[Test]
public void TestIsNotAtStation_InvalidFailureNr()
{
const string responseText = "Failure 2177: bike 1545 out of GEO fencing. 15986 meter distance to next station 105. OK: bike 1545 locked confirmed";
NotAtStationException exception = null;
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
Is.EqualTo(false));
}
}
}

View file

@ -1,37 +0,0 @@
using NUnit.Framework;
using TINK.Repository.Exception;
namespace TestTINKLib.Fixtures.ObjectTests.Repository.Exception
{
[TestFixture]
public class TestNotAtStationException
{
[Test]
public void TestIsNotAtStation()
{
const string responseText = "Failure 2178: bike 1545 out of GEO fencing. 15986 meter distance to next station 105. OK: bike 1545 locked confirmed";
NotAtStationException exception = null;
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
Is.EqualTo(true));
Assert.That(() => exception.StationNr,
Is.EqualTo(105));
Assert.That(() => exception.Distance,
Is.EqualTo(15986));
}
[Test]
public void TestIsNotAtStation_InvalidNr()
{
const string responseText = "Failure 2177: bike 1545 out of GEO fencing. 15986 meter distance to next station 105. OK: bike 1545 locked confirmed";
NotAtStationException exception = null;
Assert.That(() => NotAtStationException.IsNotAtStation(responseText, out exception),
Is.EqualTo(false));
}
}
}

View file

@ -38,9 +38,6 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Fixtures\ObjectTests\Repository\Exception\TestBookingDeclinedException.cs" />
<Compile Include="Fixtures\ObjectTests\Repository\Exception\TestNoGPSDataException.cs" />
<Compile Include="Fixtures\ObjectTests\Repository\Exception\TestNotAtStationException.cs" />
<Compile Include="Fixtures\ObjectTests\Services\BluetoothLock\Tdo\TestLockInfoAuthTdo.cs" /> <Compile Include="Fixtures\ObjectTests\Services\BluetoothLock\Tdo\TestLockInfoAuthTdo.cs" />
<Compile Include="Fixtures\ObjectTests\Services\TestLocksServicesContainerMutable.cs" /> <Compile Include="Fixtures\ObjectTests\Services\TestLocksServicesContainerMutable.cs" />
<Compile Include="Fixtures\ObjectTests\Services\TestServicesContainerMutable.cs" /> <Compile Include="Fixtures\ObjectTests\Services\TestServicesContainerMutable.cs" />