Version 3.0.337

This commit is contained in:
Anja Müller-Meißner 2022-08-30 15:42:25 +02:00
parent fd0e63cf10
commit 573fe77e12
2336 changed files with 33688 additions and 86082 deletions

View file

@ -6,6 +6,13 @@
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
mc:Ignorable="d"
x:Class="TINK.View.Account.AccountPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingAccount}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Content>
<Frame>
<StackLayout>
@ -17,7 +24,8 @@
<Button Text="{x:Static resources:AppResources.MessageAccountPageManagePersonalData}"
Command="{Binding OnManageAccount}"
IsEnabled="{Binding IsLogoutPossible}"/>
<Button Text="{x:Static resources:AppResources.MessageAccountPageManageLogout}"
<Button Style="{StaticResource SecondaryButton}"
Text="{x:Static resources:AppResources.MessageAccountPageManageLogout}"
Command="{Binding OnLogoutRequest}"
IsEnabled="{Binding IsLogoutPossible}"/>
</StackLayout>

View file

@ -8,6 +8,7 @@ using TINK.View.MasterDetail;
using System;
using TINK.Model.Device;
using TINK.ViewModel.Account;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
namespace TINK.View.Account
{
@ -149,7 +150,7 @@ namespace TINK.View.Account
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
}
}

View file

@ -5,6 +5,7 @@
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
mc:Ignorable="d"
x:Class="TINK.View.Bike.ILockItBike">
<ContentView>
@ -13,18 +14,53 @@
</ContentView.Resources>
<StackLayout
Padding="10">
<!-- Name of the bike -->
<Label
FontAttributes="Bold"
FontSize="Large"
HorizontalTextAlignment="Center"
Text="{Binding Name}"/>
<!-- Id of the bike -->
<Label
FontAttributes="Bold"
HorizontalTextAlignment="Center"
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
Text="{Binding DisplayId}"/>
<Grid Padding="0,0,5,10">
<Grid.RowDefinitions>
<RowDefinition Height="30" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="20" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Icon of the bike -->
<Image
Source="{Binding DisplayedBikeImageSourceString}"
HeightRequest="80"
Aspect="AspectFit"
HorizontalOptions="Start"
Grid.Row="0"
Grid.RowSpan="2"
Grid.Column="0"
Grid.ColumnSpan="2"/>
<!-- Battery level -->
<sharedGui:BarLevelView
Current="{Binding CurrentChargeBars}"
Maximum="{Binding MaxChargeBars}"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
IsVisible="{Binding IsBatteryChargeVisible}"/>
<!-- Name of the bike -->
<Label
FontAttributes="Bold"
FontSize="Large"
HorizontalTextAlignment="Right"
Text="{Binding Name}"
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="3"/>
<!-- Id of the bike -->
<Label
FontAttributes="Bold"
HorizontalTextAlignment="Right"
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
Text="{Binding DisplayId}"
Grid.Row="1"
Grid.Column="3"/>
</Grid>
<!-- Rental state -->
<Label
Text="{Binding StateText}"
@ -33,12 +69,19 @@
Text="{Binding ErrorText}"
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
TextColor="Red"/>
<!-- Low Battery level -->
<Label
x:Name="LowLevelLabel"
Text="{x:Static resources:AppResources.StatusTextLowBatteryLevel}"
FontSize="Small"
IsVisible="{Binding IsCurrentChargeLow}" />
<Button
Text="{Binding ButtonText}"
IsVisible="{Binding IsButtonVisible}"
IsEnabled="{Binding IsIdle}"
Command="{Binding OnButtonClicked}"/>
<Button
<Button
Style="{StaticResource SecondaryButton}"
Text="{Binding LockitButtonText}"
IsVisible="{Binding IsLockitButtonVisible}"
IsEnabled="{Binding IsIdle}"

View file

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TINK.Model.Bikes.Bike.BluetoothLock;
using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;

View file

@ -3,8 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.BikesAtStation.BikesAtStationPage"
xmlns:local_bike="clr-namespace:TINK.View.Bike"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
Title="{Binding Title}">
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{Binding Title}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
@ -45,6 +51,29 @@
<!-- Status bar stack layout-->
<StackLayout
Orientation="Vertical">
<StackLayout
Orientation="Horizontal">
<Label
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="#D21113" iOS="#D21113" WinPhone="#D21113" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
<BoxView HeightRequest="1" Color="{DynamicResource primary-back-title-color}"/>
<Label
TextType="Html"
Text="{Binding ContactSupportHintText}">
@ -60,27 +89,6 @@
<TapGestureRecognizer Command="{Binding LoginRequiredHintClickedCommand}"/>
</Label.GestureRecognizers>
</Label>
<StackLayout
Orientation="Horizontal">
<Label
HeightRequest="20"
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"
iOS="#2499CE" WinPhone="#2499CE" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
</StackLayout>
</StackLayout>
</Frame>

View file

@ -1,7 +1,7 @@

using TINK.Model.Bikes.BikeInfoNS.BluetoothLock;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using TINK.Model.Bike.BluetoothLock;
namespace TINK.View.BikesAtStation
{
@ -23,6 +23,7 @@ namespace TINK.View.BikesAtStation
using TINK.ViewModel.BikesAtStation;
using TINK.ViewModel.Bikes;
using Xamarin.CommunityToolkit.Extensions;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
[XamlCompilation(XamlCompilationOptions.Compile)]
#if USEFLYOUT
@ -68,7 +69,7 @@ namespace TINK.View.BikesAtStation
{
// Don't repeat the initialization if it has been completed already.
if (isInitializationStarted) return;
isInitializationStarted = true;
isInitializationStarted = true;
if (m_oViewModel != null)
{
@ -242,7 +243,7 @@ namespace TINK.View.BikesAtStation
/// <summary> Displays user feedback popup.</summary>
/// <param name="co2Saving"> Co2 saving information.</param>
/// <returns>User feedback.</returns>
public async Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(co2Saving));
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery, co2Saving));
#endif
}
}

View file

@ -3,8 +3,14 @@
xmlns:conv="clr-namespace:TINK.View"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Contact.ContactPage"
Title="{x:Static resources:AppResources.MarkingContactPageTitle}">
x:Class="TINK.View.Contact.ContactPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingContactPageTitle}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Resources>
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="StringNotNullOrEmpty_Converter"/>
<conv:BoolInverterConverter x:Key="BoolInvert_Converter"/>
@ -19,10 +25,10 @@
Converter={StaticResource BoolInvert_Converter}}">
<!-- Button to select station and explanation text -->
<StackLayout>
<Label
<Label
TextType="Html"
Text="{x:Static resources:AppResources.MarkingContactNoStationInfoAvailableNoButton}"/>
<Button
<Button
Text="{x:Static resources:AppResources.ActionSelectStation}"
Command="{Binding OnSelectStationRequest}"/>
</StackLayout>
@ -36,7 +42,7 @@
HorizontalOptions="Center"
FontAttributes="Bold"
Text="{Binding ProviderNameText}"/>
<!--- Mail address -->
<!--- Mail to operator -->
<Label
IsVisible="{Binding MailAddressText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
FormattedText="{Binding MailAddressAndMotivationsText}"/>
@ -46,11 +52,12 @@
Text="{Binding MailAddressText}"
IsEnabled="{Binding IsSendMailAvailable}"
Command="{Binding OnMailRequest}"/>
<!--- Mail address -->
<!--- Phone -->
<Label
IsVisible="{Binding PhoneNumberText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
FormattedText="{Binding PhoneContactText}"/>
<Button
<Button
Style="{StaticResource SecondaryButton}"
x:Name="PhoneNumberButton"
IsVisible="{Binding PhoneNumberText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
Text="{Binding PhoneNumberText}"
@ -61,8 +68,22 @@
<Frame>
<StackLayout>
<Label FormattedText="{Binding LikeTinkApp}"/>
<Button Text="{x:Static resources:AppResources.ActionContactRate}"
Command="{Binding OnRateRequest}"/>
<!--- Mail to app- releated support -->
<Button
Text="{x:Static resources:AppResources.ActionContactMailAppReleated}"
IsEnabled="{Binding IsSendMailAvailable}"
Command="{Binding OnMailAppRelatedRequest}"/>
<!--- Link to App Store -->
<Label
Margin="0,10,0,0"
TextType="Html"
HorizontalOptions="Center"
TextColor="{DynamicResource primary-back-title-color}"
Text="{x:Static resources:AppResources.ActionContactRate}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding OnRateRequest}"/>
</Label.GestureRecognizers>
</Label>
</StackLayout>
</Frame>
</StackLayout>

View file

@ -1,6 +1,7 @@
using Serilog;
using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
@ -119,7 +120,7 @@ namespace TINK.View.Contact
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
#if USEFLYOUT

View file

@ -4,8 +4,14 @@
xmlns:maps="clr-namespace:Xamarin.Forms.GoogleMaps;assembly=Xamarin.Forms.GoogleMaps"
xmlns:bindings="clr-namespace:Xamarin.Forms.GoogleMaps.Bindings;assembly=Xamarin.Forms.GoogleMaps.Bindings"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Contact.SelectStationPage"
Title="{x:Static resources:AppResources.MarkingSelectStationPage}">
x:Class="TINK.View.Contact.SelectStationPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingSelectStationPage}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Content>
<StackLayout>
<Grid
@ -26,8 +32,9 @@
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
HeightRequest="20"
HeightRequest="24"
Text="{Binding StatusInfoText}"
FontSize="Small"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsRunning}"
@ -40,7 +47,7 @@
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
iOS="#2499CE" WinPhone="#2499CE" />
Android="#D21113" iOS="#D21113" WinPhone="#D21113" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>

View file

@ -9,6 +9,7 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Contact
{
using Serilog;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.ViewModel.Contact;
[XamlCompilation(XamlCompilationOptions.Compile)]
@ -114,7 +115,7 @@ namespace TINK.View.Contact
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
#if USEFLYOUT

View file

@ -1,7 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage 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.CopriWebView.ManageAccountPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MessageAccountPageManagePersonalData}"/>
</Grid>
</Shell.TitleView>
<Shell.BackButtonBehavior>
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
</Shell.BackButtonBehavior>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>

View file

@ -1,4 +1,5 @@
using Serilog;
using System.Globalization;
using Serilog;
using TINK.Model.Device;
using TINK.ViewModel.Login;
using Xamarin.Forms;
@ -7,11 +8,11 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.CopriWebView
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class ManageAccountPage : ContentPage
{
public ManageAccountPage ()
{
InitializeComponent ();
public partial class ManageAccountPage : ContentPage
{
public ManageAccountPage()
{
InitializeComponent();
ManageAccount.Navigating += (sender, ev) =>
{
@ -51,6 +52,7 @@ namespace TINK.View.CopriWebView
ManageAccount.BindingContext = new ManageAccountViewModel(
App.ModelRoot.ActiveUser.SessionCookie,
Model.TinkApp.MerchantId,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
App.ModelRoot.NextActiveUri.Host);
}
}

View file

@ -1,7 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage 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.CopriWebView.PasswordForgottenPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}"/>
</Grid>
</Shell.TitleView>
<Shell.BackButtonBehavior>
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
</Shell.BackButtonBehavior>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>

View file

@ -1,4 +1,5 @@

using System.Globalization;
using Serilog;
using TINK.ViewModel.CopriWebView;
using Xamarin.Forms;
@ -43,6 +44,7 @@ namespace TINK.View.CopriWebView
PasswordForgottenWebView.BindingContext = new PasswordForgottonViewModel(
Model.TinkApp.MerchantId,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
App.ModelRoot.NextActiveUri.Host);
}
}

View file

@ -1,7 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage 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.CopriWebView.RegisterPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.ActionLoginRegister}"/>
</Grid>
</Shell.TitleView>
<Shell.BackButtonBehavior>
<BackButtonBehavior IconOverride="{FontImage FontFamily=FA-S, Glyph={StaticResource IconClose}, Color=White, Size=16}" />
</Shell.BackButtonBehavior>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>

View file

@ -1,4 +1,5 @@

using System.Globalization;
using Serilog;
using TINK.Model.Device;
using TINK.ViewModel.CopriWebView;
@ -46,6 +47,7 @@ namespace TINK.View.CopriWebView
RegisterView.BindingContext = new RegisterPageViewModel(
Model.TinkApp.MerchantId,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
App.ModelRoot.NextActiveUri.Host);
}

View file

@ -4,7 +4,9 @@
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
xmlns:local="clr-namespace:TINK.View"
x:TypeArguments="local:FeedbackPopup+Result"
x:Class="TINK.View.FeedbackPopup">
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.FeedbackPopup">
<xct:Popup.Resources>
<x:String x:Key="check_circle">&#xf058;</x:String>
</xct:Popup.Resources>
@ -19,25 +21,28 @@
<!--- ok button-->
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<!-- Head and title -->
<Grid
<!-- Head and title - Grid.Row 0 -->
<Grid Grid.Row="0"
Padding="30"
BackgroundColor="{DynamicResource primary-back-title-color}">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Label
<Label Grid.Row="0"
HorizontalTextAlignment="Center"
FontSize="Large"
Text="Fahrrad erfolgreich zurückgegeben!"/>
TextColor="White"
Text="{x:Static resources:AppResources.MarkingReturnBikeMainMessage}"/>
<Image Grid.Row="1">
<Image.Source>
<FontImageSource Size="Header" Glyph="{StaticResource check_circle}" FontFamily="FA-S"/>
<FontImageSource Size="Title" Glyph="{StaticResource check_circle}" FontFamily="FA-S"/>
</Image.Source>
</Image>
</Grid>
<!-- Co2saving -->
<!-- Co2saving - Grid.Row 1-->
<Frame
x:Name="Co2SavingFrame"
Grid.Row="1">
@ -45,54 +50,64 @@
x:Name="Co2SavingLabel"
Text=""/>
</Frame>
<!-- Checkbox and input elements -->
<!-- Checkbox and input elements - Grid.Row 2-->
<ScrollView Grid.Row="2">
<Grid>
<Grid.RowDefinitions>
<!--- Battery charge level -->
<RowDefinition Height="Auto"/>
<!--- Bike is ok GUI -->
<RowDefinition Height="Auto"/>
<!--- Feedback edit GUI -->
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackLayout
Orientation="Vertical">
<Grid>
<!-- Battery level -->
<sharedGui:BarLevelInputView Grid.Row="0"
x:Name="BarLevelInputView"
HorizontalOptions="Center"/>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Checkbox Is Broken -->
<CheckBox x:Name="brockenCheckBox" IsChecked="True"/>
<Label
Grid.Column="1"
FontSize="Medium"
Text="Rad ist in Ordnung"/>
Text= "{x:Static resources:AppResources.MarkingReturnBikeBikeStateIsOK}"/>
</Grid>
<Editor
Grid.Row="1"
Grid.Row="2"
x:Name="feedbackMessage"
AutoSize="TextChanges"
Placeholder="Bei Bedarf bitte hier Rückmeldung eingeben."
Placeholder="{x:Static resources:AppResources.MarkingReturnBikeFeedbackInputPlaceholder}"
Text="">
<Editor.Triggers>
<DataTrigger TargetType="Editor"
Binding="{Binding Source={x:Reference brockenCheckBox}, Path=IsChecked}"
Value="true">
<Setter Property="Placeholder"
Value="Bei Bedarf bitte hier Rückmeldung eingeben." />
Value="{x:Static resources:AppResources.MarkingReturnBikeFeedbackInputPlaceholder}" />
</DataTrigger>
<DataTrigger TargetType="Editor"
Binding="{Binding Source={x:Reference brockenCheckBox}, Path=IsChecked}"
Value="false">
<Setter Property="Placeholder"
Value="Bitte Zustand/ Defekt hier beschreiben." />
Value="{x:Static resources:AppResources.MarkingReturnBikeErrorDescriptionInputPlaceholder}" />
</DataTrigger>
</Editor.Triggers>
</Editor>
</StackLayout>
</Grid>
</ScrollView>
<!-- Buttons -->
<!-- Buttons - Grid.Row 3 -->
<Button
Grid.Row="3"
WidthRequest="100"
Clicked="OnOkClicked"
Text="OK"/>
Text="OK"
Margin="0,0,0,3"/>
</Grid>
</xct:Popup>

View file

@ -1,4 +1,5 @@
using System;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using Xamarin.CommunityToolkit.UI.Views;
using Xamarin.Forms.Xaml;
@ -8,22 +9,42 @@ namespace TINK.View
public partial class FeedbackPopup : Popup<FeedbackPopup.Result>
{
/// <summary> Constructs user feedback popup.</summary>
/// <param name="battery">Object holding info about battery. For some batteries charging level might need to be updated by user.</param>
/// <param name="co2Saving"> Co2 saving information.</param>
public FeedbackPopup(string co2Saving = null)
public FeedbackPopup(
IBattery battery = null,
string co2Saving = null)
{
InitializeComponent();
if (string.IsNullOrEmpty(co2Saving))
Co2SavingFrame.IsVisible = false;
else
Co2SavingLabel.Text = co2Saving;
if (battery == null
|| (battery.IsBackendAccessible.HasValue && battery.IsBackendAccessible.Value))
{
// Either
// - bike has no engine or
// - backend can access battery level information
// No need to ask user for input.
return;
}
BarLevelInputView.IsVisible = battery?.MaxChargeBars != null;
BarLevelInputView.Current = battery?.CurrentChargeBars?.ToString() ?? string.Empty;
BarLevelInputView.Maximum = battery?.MaxChargeBars != null ? battery?.MaxChargeBars.ToString() : String.Empty;
}
protected override FeedbackPopup.Result GetLightDismissResult()
{
return new Result
{
Message = feedbackMessage.Text,
IsBikeBroken = brockenCheckBox.IsChecked
CurrentChargeBars = int.TryParse(BarLevelInputView.Current, out int current) ? (int?)current : null,
IsBikeBroken = brockenCheckBox.IsChecked,
Message = feedbackMessage.Text
};
}
@ -31,8 +52,9 @@ namespace TINK.View
{
var result = new Result
{
Message = feedbackMessage.Text,
IsBikeBroken = brockenCheckBox.IsChecked
CurrentChargeBars = int.TryParse(BarLevelInputView.Current, out int current) ? (int?)current : null,
IsBikeBroken = brockenCheckBox.IsChecked,
Message = feedbackMessage.Text
};
Dismiss(result);
@ -47,6 +69,11 @@ namespace TINK.View
public new class Result : IUserFeedback
#endif
{
/// <summary>
/// Holds the current chargeing level of the battery entered by user in bars, null if unkonwn.
/// </summary>
public int? CurrentChargeBars { get; set; }
/// <summary>
/// Holds whether bike is broken or not.
/// </summary>

View file

@ -3,6 +3,13 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Contact.FeesAndBikesPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingFeesAndBikes}"/>
</Grid>
</Shell.TitleView>
<!--Pages can be added as references or inline-->
<ContentPage Title="{x:Static resources:AppResources.MarkingTabFees}">
<ContentPage.Content>

View file

@ -1,7 +1,7 @@
using TINK.ViewModel;
using TINK.ViewModel.Contact;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using TINK.ViewModel.Contact;
namespace TINK.View.Contact
{
@ -10,7 +10,7 @@ namespace TINK.View.Contact
{
public FeesAndBikesPageViewModel ViewModel { get; }
public FeesAndBikesPage ()
public FeesAndBikesPage()
{
InitializeComponent();
@ -26,7 +26,7 @@ namespace TINK.View.Contact
InfoRentBikeWebView.Navigating += ViewModelHelper.OnNavigating;
/// Info about types of bikes.
InfoTypesOfBikesWebView.Navigating += ViewModelHelper.OnNavigating;
InfoTypesOfBikesWebView.Navigating += ViewModelHelper.OnNavigating;
}
/// <summary> Called when page is shown. </summary>

View file

@ -2,7 +2,15 @@
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.FindBike.FindBikePage"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:local_bike="clr-namespace:TINK.View.Bike">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingFindBike}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
@ -36,8 +44,9 @@
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
HeightRequest="20"
HeightRequest="24"
Text="{Binding StatusInfoText}"
FontSize="Small"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsRunning}"
@ -50,7 +59,7 @@
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
iOS="#2499CE" WinPhone="#2499CE" />
Android="#D21113" iOS="#D21113" WinPhone="#D21113" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>

View file

@ -1,7 +1,8 @@
using Serilog;
using System;
using System;
using System.Threading;
using System.Threading.Tasks;
using Serilog;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
using TINK.ViewModel.FindBike;
using Xamarin.CommunityToolkit.Extensions;
@ -10,13 +11,13 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.FindBike
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FindBikePage : ContentPage, IViewService
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FindBikePage : ContentPage, IViewService
{
/// <summary> Refernce to view model. </summary>
FindBikePageViewModel m_oViewModel = null;
public FindBikePage () { }
public FindBikePage() { }
/// <summary>
/// Invoked when page is shown.
@ -141,7 +142,7 @@ namespace TINK.View.FindBike
#if USCSHARP9
public async Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup());
#else
public async Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(co2Saving));
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery, co2Saving));
#endif
}
}

View file

@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
#if USEFLYOUT
using TINK.View.MasterDetail;
#endif
@ -17,9 +18,9 @@ namespace TINK.View.Info.BikeInfo
public partial class BikeInfoCarouselPage : CarouselPage, IViewService
#endif
{
public BikeInfoCarouselPage ()
{
InitializeComponent ();
public BikeInfoCarouselPage()
{
InitializeComponent();
ItemsSource = new BikeInfoViewModel(
resourceName => ImageSource.FromResource($"{ViewModelResourceHelper.RessourcePrefix}Images.{resourceName}"),
@ -122,7 +123,7 @@ namespace TINK.View.Info.BikeInfo
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
}
}

View file

@ -1,8 +1,16 @@
<?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.Info.InfoPage"
x:Name="TabbedInfoPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingAbout}"/>
</Grid>
</Shell.TitleView>
<!--Pages can be added as references or inline-->
<ContentPage Title="App">
<ContentPage.Content>

View file

@ -1,4 +1,5 @@
using TINK.ViewModel;
using System.Globalization;
using TINK.ViewModel;
using TINK.ViewModel.Info;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
@ -20,6 +21,7 @@ namespace TINK.View.Info
App.ModelRoot.ResourceUrls.PrivacyResourcePath,
App.ModelRoot.ResourceUrls.ImpressResourcePath,
App.ModelRoot.IsSiteCachingOn,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
resourceName => ViewModelResourceHelper.GetSource(resourceName));
TabbedInfoPage.BindingContext = ViewModel;

View file

@ -3,12 +3,29 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Login.LoginPage">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingLogin}"/>
</Grid>
</Shell.TitleView>
<ScrollView>
<Frame>
<StackLayout x:Name="LoginPageView">
<Frame>
<StackLayout>
<Label Text="{x:Static resources:AppResources.MarkingLoginEmailAddressLabel}"/>
<Label Text="{x:Static resources:AppResources.MarkingLoginEmailAddressLabel}"
Margin="0,0,0,-10">
<Label.Triggers>
<DataTrigger
TargetType="Label"
Binding="{Binding Source={x:Reference EMailEntry}, Path=Text, TargetNullValue=''}"
Value="">
<Setter Property="IsVisible" Value="False" />
</DataTrigger>
</Label.Triggers>
</Label>
<Entry
Placeholder="{x:Static resources:AppResources.MarkingLoginEmailAddressPlaceholder}"
Keyboard="Email"
@ -16,22 +33,45 @@
x:Name="EMailEntry"
Text="{Binding MailAddress}"
IsEnabled="{Binding IsLoggedOut}"/>
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordLabel}"/>
<Entry
Placeholder="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
Margin="0,0,0,-10">
<Label.Triggers>
<DataTrigger
TargetType="Label"
Binding="{Binding Source={x:Reference PasswordEntry}, Path=Text, TargetNullValue=''}"
Value="">
<Setter Property="IsVisible" Value="False" />
</DataTrigger>
</Label.Triggers>
</Label>
<Entry Placeholder="{x:Static resources:AppResources.MarkingLoginPasswordPlaceholder}"
AutomationId="password_text"
IsPassword="true"
x:Name="PasswordEntry"
Text="{Binding Password}"
IsEnabled="{Binding IsLoggedOut}"/>
<Label Text="{x:Static resources:AppResources.MarkingLoginPasswordLabel}"
HorizontalOptions="End"
Margin="0,-10,0,5"
FontSize="Small">
<Label.Triggers>
<DataTrigger
TargetType="Label"
Binding="{Binding Source={x:Reference PasswordEntry}, Path=Text, TargetNullValue=''}"
Value="">
<Setter Property="IsVisible" Value="False" />
</DataTrigger>
</Label.Triggers>
</Label>
<Button
Text="{x:Static resources:AppResources.ActionLoginLogin}"
Text="{x:Static resources:AppResources.ActionLoginLogin}"
AutomationId="login_button"
Command="{Binding OnLoginRequest}"
IsEnabled="{Binding IsLoginRequestAllowed}">
</Button>
<Button
Text="{x:Static resources:AppResources.ActionLoginRegister}"
Style="{StaticResource SecondaryButton}"
Text="{x:Static resources:AppResources.ActionLoginRegister}"
AutomationId="register_button"
Command="{Binding OnRegisterRequest}"
IsVisible="{Binding IsWebViewElementsVisible}">
@ -40,11 +80,17 @@
IsVisible="{Binding IsRegisterTargetsInfoVisible}"
FormattedText="{Binding RegisterTargetsInfo}">
</Label>
<Button
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}"
<Label
Margin="0,10,0,0"
TextType="Html"
AutomationId="password_forgotten_button"
Command="{Binding OnPasswordForgottonRequest}">
</Button>
HorizontalOptions="Center"
TextColor="{DynamicResource primary-back-title-color}"
Text="{x:Static resources:AppResources.ActionLoginPasswordForgotten}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding OnPasswordForgottonRequest}"/>
</Label.GestureRecognizers>
</Label>
</StackLayout>
</Frame>
</StackLayout>

View file

@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
#if USEFLYOUT
using TINK.View.MasterDetail;
@ -17,15 +18,15 @@ namespace TINK.View.Login
public partial class LoginPage : ContentPage, IViewService
#endif
{
public LoginPage ()
{
InitializeComponent ();
public LoginPage()
{
InitializeComponent();
var l_oModel = App.ModelRoot;
#if !BACKSTYLE
var l_oViewModel = new LoginPageViewModel(
l_oModel,
(url) => DependencyService.Get< IExternalBrowserService>().OpenUrl(url),
l_oModel,
(url) => DependencyService.Get<IExternalBrowserService>().OpenUrl(url),
this);
LoginPageView.BindingContext = l_oViewModel;
@ -81,7 +82,7 @@ namespace TINK.View.Login
/// <summary> Pushes a page onto the modal stack. </summary>
/// <param name="p_oTypeOfPage">Page to display.</param>
public async Task PushModalAsync(ViewTypes typeOfPage)
public async Task PushModalAsync(ViewTypes typeOfPage)
=> await Navigation.PushModalAsync((Page)Activator.CreateInstance(typeOfPage.GetViewType()));
@ -116,7 +117,7 @@ namespace TINK.View.Login
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
}
}
}
}

View file

@ -4,13 +4,26 @@
xmlns:maps="clr-namespace:Xamarin.Forms.GoogleMaps;assembly=Xamarin.Forms.GoogleMaps"
xmlns:bindings="clr-namespace:Xamarin.Forms.GoogleMaps.Bindings;assembly=Xamarin.Forms.GoogleMaps.Bindings"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.Map.MapPage"
Title="{x:Static resources:AppResources.MarkingMapPage}">
<StackLayout>
<Grid
x:Class="TINK.View.Map.MapPage"
BackgroundColor="{DynamicResource Key=primary-back-title-color}">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingMapPage}"/>
</Grid>
</Shell.TitleView>
<Grid
RowDefinitions="3,46,1*,33"
ColumnDefinitions="1*,Auto,1*"
IsEnabled="{Binding IsMapPageEnabled}"
VerticalOptions="FillAndExpand">
<maps:Map WidthRequest="320" HeightRequest="800"
VerticalOptions="FillAndExpand"
>
<maps:Map
Grid.RowSpan="3"
Grid.ColumnSpan="3"
WidthRequest="320"
HeightRequest="800"
x:Name="MyMap"
IsShowingUser="False"
MapType="Street">
@ -19,51 +32,82 @@
<bindings:PinClickedToCommandBehavior Command="{Binding PinClickedCommand}"/>
</maps:Map.Behaviors>
</maps:Map>
<Button
x:Name="TINKButton"
AutomationId ="FilterTINK_button"
Text="{x:Static resources:AppResources.MarkingCargoBike}"
Command="{Binding OnToggleKonradToTink}"
IsVisible="{Binding IsToggleVisible}"
TextColor ="{Binding TinkColor}"
VerticalOptions="Start"
HorizontalOptions="StartAndExpand"
Padding="10">
</Button>
<Button
x:Name="KonradButton"
AutomationId ="FilterKonrad_button"
Text="{x:Static resources:AppResources.MarkingCityBike}"
Command="{Binding OnToggleTinkToKonrad}"
IsVisible="{Binding IsToggleVisible}"
TextColor="{Binding KonradColor}"
VerticalOptions="Start"
HorizontalOptions="EndAndExpand"
Padding="10">
</Button>
</Grid>
<StackLayout
<Frame
CornerRadius="13"
Grid.Row="1"
Grid.Column="1"
Margin="0"
Padding="0"
BackgroundColor="{DynamicResource secondary-back-title-color}">
<StackLayout Orientation="Horizontal"
Margin="0"
Padding="0">
<Button
x:Name="KonradButton"
AutomationId ="FilterKonrad_button"
Text="{x:Static resources:AppResources.MarkingCityBike}"
Command="{Binding OnToggleTinkToKonrad}"
IsVisible="{Binding IsToggleVisible}"
BackgroundColor="{Binding KonradColor}"
BorderColor="{Binding KonradColor}"
BorderWidth="0"
VerticalOptions="Center"
HorizontalOptions="Center"
WidthRequest="94"
HeightRequest="40"
BorderRadius="10"
Margin="3,0,0,0"
FontSize="Small"
FontAttributes="Bold"
TextColor="{Binding NoKonradColor}">
</Button>
<Button
x:Name="TINKButton"
AutomationId ="FilterTINK_button"
Text="{x:Static resources:AppResources.MarkingCargoBike}"
Command="{Binding OnToggleKonradToTink}"
IsVisible="{Binding IsToggleVisible}"
BackgroundColor="{Binding TinkColor}"
BorderColor="{Binding TinkColor}"
BorderWidth="0"
VerticalOptions="Center"
HorizontalOptions="Center"
WidthRequest="94"
HeightRequest="40"
BorderRadius="10"
Margin="0,0,3,0"
FontSize="Small"
FontAttributes="Bold"
TextColor="{Binding NoTinkColor}">
</Button>
</StackLayout>
</Frame>
<StackLayout
Grid.Row="3"
Grid.ColumnSpan="3"
Margin="6,3,6,6"
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
HeightRequest="20"
Text="{Binding StatusInfoText}"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
<ActivityIndicator IsRunning="{Binding IsRunning}"
<Label
HeightRequest="24"
FontSize="Small"
Text="{Binding StatusInfoText}"
TextColor="White"
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"
iOS="#2499CE" WinPhone="#2499CE" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>
</StackLayout>
<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>
</ContentPage>

View file

@ -9,6 +9,7 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.Map
{
using Serilog;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.ViewModel.Map;
[XamlCompilation(XamlCompilationOptions.Compile)]
@ -120,7 +121,7 @@ namespace TINK.View.Map
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
#if USEFLYOUT

View file

@ -27,7 +27,9 @@
<Button
IsEnabled="False"
Command="{Binding OnButtonClicked}"
Text="OK"/>
Text="OK"
WidthRequest="100"
Margin="0,0,0,3"/>
</StackLayout>
</Frame>
</ContentPage.Content>

View file

@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.ViewModel.MiniSurvey;
using Xamarin.CommunityToolkit.Extensions;
using Xamarin.Forms;
@ -92,7 +93,7 @@ namespace TINK.View.MiniSurvey
/// <summary> Displays user feedback popup.</summary>
/// <param name="co2Saving"> Co2 saving information.</param>
/// <returns>User feedback.</returns>
public async Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(co2Saving));
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery, co2Saving));
#endif
}
}

View file

@ -3,12 +3,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MiniSurvey.Question
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CheckOneViewCell : ViewCell
{
public CheckOneViewCell ()
{
InitializeComponent ();
}
}
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class CheckOneViewCell : ViewCell
{
public CheckOneViewCell()
{
InitializeComponent();
}
}
}

View file

@ -4,12 +4,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.MiniSurvey.Question
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FreeTextViewCell : ViewCell
{
public FreeTextViewCell ()
{
InitializeComponent ();
}
}
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FreeTextViewCell : ViewCell
{
public FreeTextViewCell()
{
InitializeComponent();
}
}
}

View file

@ -3,8 +3,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.MyBikes.MyBikesPage"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
xmlns:local_bike="clr-namespace:TINK.View.Bike"
Title="{x:Static resources:AppResources.MarkingMyBikes}">
xmlns:local_bike="clr-namespace:TINK.View.Bike">
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingMyBikes}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
@ -34,7 +40,8 @@
<StackLayout
Orientation="Horizontal">
<Label
HeightRequest="20"
HeightRequest="24"
FontSize="Small"
Text="{Binding StatusInfoText}"
VerticalOptions="Center"
HorizontalOptions="FillAndExpand"/>
@ -48,7 +55,7 @@
</ActivityIndicator.WidthRequest>
<ActivityIndicator.Color>
<OnPlatform x:TypeArguments="Color"
iOS="#2499CE" WinPhone="#2499CE" />
Android="#D21113" iOS="#D21113" WinPhone="#D21113" />
</ActivityIndicator.Color>
</ActivityIndicator>
</StackLayout>

View file

@ -12,6 +12,7 @@ namespace TINK.View.MyBikes
{
using Serilog;
using TINK.Model;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
using TINK.ViewModel.MyBikes;
using Xamarin.CommunityToolkit.Extensions;
@ -40,7 +41,7 @@ namespace TINK.View.MyBikes
{
// Don't repeat the initialization if it has been completed already.
if (isInitializationStarted) return;
isInitializationStarted = true;
isInitializationStarted = true;
if (m_oViewModel != null)
{
@ -179,7 +180,7 @@ namespace TINK.View.MyBikes
/// <summary> Displays user feedback popup.</summary>
/// <param name="co2Saving"> Co2 saving information.</param>
/// <returns>User feedback.</returns>
public async Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(co2Saving));
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery, co2Saving));
#endif
}
}

View file

@ -31,7 +31,7 @@ namespace TINK.View.Root
// Any type of split behaviour conflics with map shifting functionality (assuming FlyoutPage behaves same like MasterDetailPage).
FlyoutLayoutBehavior = FlyoutLayoutBehavior.Popover;
var navigationPage = Detail as NavigationPage;
if (navigationPage == null)
{

View file

@ -12,8 +12,8 @@ namespace TINK.View
}
public MainPageMenuItem(
int p_iId,
Type p_oTypeOfPage,
int p_iId,
Type p_oTypeOfPage,
string p_strTitle = null)
{
TargetType = p_oTypeOfPage;

View file

@ -11,100 +11,80 @@
xmlns:contact="clr-namespace:TINK.View.Contact"
xmlns:info="clr-namespace:TINK.View.Info"
xmlns:header="clr-namespace:TINK.View.RootShell"
BackgroundColor="{DynamicResource Key=primary-back-title-color}"
Title="Shell"
x:Class="TINK.View.RootShell.AppShell">
<Shell.FlyoutHeader>
<header:FlyoutHeader/>
</Shell.FlyoutHeader>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingMapPage}"
Icon="menu_bikelocations.png"
Route="MapPage"
ContentTemplate="{DataTemplate mappage:MapPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconMap}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
ContentTemplate="{DataTemplate mappage:MapPage}"/>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingFindBike}"
Icon="menu_looking.png"
IsVisible="{Binding IsFindBikePageVisible}"
ContentTemplate="{DataTemplate findbike:FindBikePage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconFindBike}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingMyBikes}"
Icon="menu_mybikes.png"
IsVisible="{Binding IsMyBikesPageVisible}"
ContentTemplate="{DataTemplate mybikes:MyBikesPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconMyBikes}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingAccount}"
Icon="menu_account.png"
IsVisible="{Binding IsAccountPageVisible}"
ContentTemplate="{DataTemplate account:AccountPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconAccount}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingLogin}"
Icon="menu_account.png"
Route="LoginPage"
IsVisible="{Binding IsLoginPageVisible}"
ContentTemplate="{DataTemplate login:LoginPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconLogin}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{x:Static resources:AppResources.MarkingSettings}"
Icon="menu_settings.png"
IsVisible="{Binding IsSettingsPageVisible}"
ContentTemplate="{DataTemplate settings:SettingsPage}">
<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}"
Icon="menu_using.png"
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}"
Icon="menu_contact.png"
Route="ContactPage"
ContentTemplate="{DataTemplate contact:ContactPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconContact}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<FlyoutItem FlyoutDisplayOptions="AsMultipleItems">
<ShellContent
Title="{Binding TabbedPageIngoTitle}"
Icon="menu_info.png"
ContentTemplate="{DataTemplate info:InfoPage}">
<ShellContent.FlyoutIcon>
<FontImageSource Glyph="{StaticResource IconInfo}" Color="Black" FontFamily="FA-S" />
</ShellContent.FlyoutIcon>
</ShellContent>
</FlyoutItem>
<Shell.FlyoutFooter>

View file

@ -1,21 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:TINK.View;assembly=TINKLib"
x:Class="TINK.View.RootShell.FlyoutFooter">
<Grid Padding="5,10">
<Grid Padding="20,0,0,20">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="30" />
<RowDefinition Height="35"/>
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<Image
HeightRequest="30"
Aspect="AspectFit"
Source="konrad_nobg.png" />
<Image
Grid.Row="0"
HeightRequest="35"
HorizontalOptions="StartAndExpand"
Aspect="AspectFit"
Source="konrad_nobg.png" />
<Label
HorizontalOptions="CenterAndExpand"
FontSize="Medium"
Grid.Row="1"
Grid.Row="1"
HorizontalOptions="Start"
FontSize="12"
TextColor="{DynamicResource primary-back-title-color}"
TextType="Html"
Text="Powered by &lt;b&gt;Stadtwerke Konstanz&lt;/b&gt;"/>
<!--<Label
Grid.Row="1"
HorizontalOptions="Start"
FontSize="12"
TextColor="{DynamicResource primary-back-title-color}">
<Label.FormattedText>
<FormattedString>
<Span Text="powered by " />
<local:HyperlinkSpan Text="Stadtwerke Konstanz"
FontAttributes="Bold"
Url="https://www.stadtwerke-konstanz.de" />
</FormattedString>
</Label.FormattedText>
</Label>-->
</Grid>
</ContentView>

View file

@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.RootShell
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutFooter : ContentView
{
public FlyoutFooter ()
{
InitializeComponent ();
}
}
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutFooter : ContentView
{
public FlyoutFooter()
{
InitializeComponent();
}
}
}

View file

@ -1,16 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
BackgroundColor="{DynamicResource Key=primary-back-title-color}"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
x:Class="TINK.View.RootShell.FlyoutHeader">
<Grid Padding="5,10">
<Grid Padding="0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<Label
HorizontalOptions="Center"
FontSize="Medium"
Grid.Row="0"
Text="Menu"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Image Source="menu_swk_theme.png"
Aspect="AspectFill"
Grid.ColumnSpan="2"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingFlyoutHeader}"/>
</Grid>
</ContentView>

View file

@ -9,12 +9,12 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.RootShell
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutHeader : ContentView
{
public FlyoutHeader ()
{
InitializeComponent ();
}
}
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class FlyoutHeader : ContentView
{
public FlyoutHeader()
{
InitializeComponent();
}
}
}

View file

@ -19,7 +19,13 @@
<conv:PermissionToVisibleConverter x:Key="ShowDiagnostics_Converter" VisibleFlag="{x:Static account:Permissions.ShowDiagnostics}"/>
<conv:PermissionToVisibleConverter x:Key="SwitchSiteCaching_Converter" VisibleFlag="{x:Static account:Permissions.SwitchNoSiteCaching}"/>
</ContentPage.Resources>
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Image Style="{StaticResource Image-Navbar}"/>
<Label Style="{StaticResource Label-Navbar}"
Text="{x:Static resources:AppResources.MarkingSettings}"/>
</Grid>
</Shell.TitleView>
<ContentPage.Content>
<ScrollView>
<Frame>

View file

@ -8,6 +8,7 @@ using TINK.View.MasterDetail;
using System;
using TINK.Model.Device;
using Xamarin.CommunityToolkit.Extensions;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
namespace TINK.View.Settings
{
@ -22,9 +23,9 @@ namespace TINK.View.Settings
SettingsPageViewModel m_oViewModel = null;
/// <summary> Constructs a settings page. </summary>
public SettingsPage ()
{
InitializeComponent ();
public SettingsPage()
{
InitializeComponent();
var l_oModel = App.ModelRoot;
@ -73,7 +74,7 @@ namespace TINK.View.Settings
/// <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)
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>
@ -104,7 +105,7 @@ namespace TINK.View.Settings
/// <summary> Pushes a page onto the modal stack. </summary>
/// <param name="p_oTypeOfPage">Page to display.</param>
public Task PushModalAsync(ViewTypes p_oTypeOfPage)
=> throw new NotImplementedException();
=> throw new NotImplementedException();
/// <summary> Pops a page from the modal stack. </summary>
public Task PopModalAsync()
@ -149,7 +150,7 @@ namespace TINK.View.Settings
/// <summary> Displays user feedback popup.</summary>
/// <param name="co2Saving"> Co2 saving information.</param>
/// <returns>User feedback.</returns>
public async Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup());
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => await Navigation.ShowPopupAsync<FeedbackPopup.Result>(new FeedbackPopup(battery, co2Saving));
#endif
#if USERFEEDBACKDLG_TRYOUT

View file

@ -1,17 +1,17 @@
using System;
using TINK.View.BikesAtStation;
using TINK.View.Contact;
using TINK.View.CopriWebView;
using TINK.View.Info;
using TINK.View.Info.BikeInfo;
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.BikesAtStation;
using Xamarin.Forms;
using TINK.View.MiniSurvey;
namespace TINK.View
{

View file

@ -9,8 +9,11 @@
HeightRequest="1000"
WidthRequest="500"
Source="{Binding InfoAgb}"/>
<Button Text="OK"
Command="{Binding OnOk}"/>
<Button
Text="OK"
WidthRequest="100"
Command="{Binding OnOk}"
Margin="0,0,0,3"/>
</StackLayout>
</Frame>

View file

@ -1,5 +1,7 @@
using System;
using System.Globalization;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.ViewModel;
using TINK.ViewModel.WhatsNew.Agb;
using Xamarin.Forms;
@ -8,15 +10,16 @@ using Xamarin.Forms.Xaml;
namespace TINK.View.WhatsNew.Agb
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class AgbPage : ContentPage, IViewService
{
public AgbPage ()
{
InitializeComponent ();
public partial class AgbPage : ContentPage, IViewService
{
public AgbPage()
{
InitializeComponent();
agbViewModel = new AgbViewModel(
App.ModelRoot.NextActiveUri.Host,
App.ModelRoot.IsSiteCachingOn,
CultureInfo.CurrentUICulture.TwoLetterISOLanguageName,
(resourceName) => ViewModelResourceHelper.GetSource(resourceName),
this);
@ -47,7 +50,7 @@ namespace TINK.View.WhatsNew.Agb
/// <summary> Invoked when page is shown. </summary>
protected async override void OnAppearing()
=> await agbViewModel.OnAppearing();
=> await agbViewModel.OnAppearing();
/// <summary> Reference to view model.</summary>
AgbViewModel agbViewModel;
@ -75,7 +78,7 @@ namespace TINK.View.WhatsNew.Agb
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
}
}

View file

@ -34,7 +34,9 @@
<Button
Text="OK"
Command="{Binding OnOk}"/>
WidthRequest="100"
Command="{Binding OnOk}"
Margin="0,0,0,3"/>
</StackLayout>
</Frame>
</ScrollView>

View file

@ -1,5 +1,6 @@
using System;
using System.Threading.Tasks;
using TINK.Model.Bikes.BikeInfoNS.DriveNS.BatteryNS;
using TINK.Model.Device;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
@ -79,7 +80,7 @@ namespace TINK.View.WhatsNew
#if USCSHARP9
public Task<IViewService.IUserFeedback> DisplayUserFeedbackPopup() => throw new NotSupportedException();
#else
public Task<IUserFeedback> DisplayUserFeedbackPopup(string co2Saving = null) => throw new NotSupportedException();
public async Task<IUserFeedback> DisplayUserFeedbackPopup(IBattery battery = null, string co2Saving = null) => throw new NotSupportedException();
#endif
/// <summary>
@ -97,7 +98,7 @@ namespace TINK.View.WhatsNew
WhatsNewViewModel?.OnDisappearing(() =>
{
App.ModelRoot.SetWhatsNewWasShown();
App.ModelRoot.WhatsNew.WasShownInCurrentSession = true;
App.ModelRoot.Save();
});
}