Contact page shows operator specific info

This commit is contained in:
Oliver Hauff 2021-07-20 23:06:09 +02:00
parent e436e83c1d
commit a58c33f005
51 changed files with 948 additions and 221 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.240" android:versionCode="240">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.hauffware.sharee" android:versionName="3.0.241" android:versionCode="241">
<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="30" />
<!-- Google Maps related permissions -->
<permission android:name="com.ecs.google.maps.v2.actionbarsherlock.permission.MAPS_RECEIVE" android:protectionLevel="signature" />

View file

@ -49,8 +49,8 @@
<key>CFBundleDisplayName</key>
<string>sharee.bike</string>
<key>CFBundleVersion</key>
<string>240</string>
<string>241</string>
<key>CFBundleShortVersionString</key>
<string>3.0.240</string>
<string>3.0.241</string>
</dict>
</plist>

View file

@ -29,6 +29,7 @@
<DependentUpon>ILockItBike.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)View\BoolInverterConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)View\FeedbackPopup.xaml.cs">
<DependentUpon>FeedbackPopup.xaml</DependentUpon>
<SubType>Code</SubType>

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TINK.View.BikesAtStation.BikesAtStationPage"
xmlns:local_bike="clr-namespace:TINK.View.Bike"
Title="{Binding Title}">
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}">
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
@ -11,7 +12,8 @@
</ContentPage.Resources>
<ContentPage.Content>
<Frame>
<StackLayout>
<StackLayout
Orientation="Vertical">
<ListView
x:Name="BikesAtStationListView"
SelectionMode="None"
@ -19,21 +21,29 @@
IsEnabled="{Binding IsIdle}"
IsVisible="{Binding IsBikesListVisible}"
HasUnevenRows="True"
ItemTemplate="{StaticResource bikeTemplateSelector}"/>
<StackLayout
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
ItemTemplate="{StaticResource bikeTemplateSelector}"/>
<Label
IsVisible="{Binding IsNoBikesAtStationVisible}"
VerticalOptions="EndAndExpand"
Text="{Binding NoBikesAtStationText}"/>
<Label
<Label
TextType="Html"
Text="{Binding ContactSupportHintText}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ContactSupportClickedCommand}"/>
</Label.GestureRecognizers>
</Label>
<Label
IsVisible="{Binding IsLoginRequiredHintVisible}"
FormattedText="{Binding LoginRequiredHintText}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding LoginRequiredHintClickedCommand}"/>
</Label.GestureRecognizers>
</Label>
TextType="Html"
Text="{Binding LoginRequiredHintText}">
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding LoginRequiredHintClickedCommand}"/>
</Label.GestureRecognizers>
</Label>
<StackLayout
VerticalOptions="EndAndExpand"
Orientation="Horizontal">
<Label
HeightRequest="20"
Text="{Binding StatusInfoText}"

View file

@ -0,0 +1,19 @@
using System;
using System.Globalization;
using Xamarin.Forms;
namespace TINK.View
{
/// <summary> Inverts a bool.</summary>
public class BoolInverterConverter : IValueConverter
{
/// <summary> Inverts a bool.</summary>
/// <param name="value">Bool to invert.</param>
/// <returns>Inverted bool.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
=> value is bool flag && !flag;
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> value is bool flag && !flag;
}
}

View file

@ -1,27 +1,49 @@
<?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: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="Kontakt">
x:Class="TINK.View.Contact.ContactPage"
Title="Kontakt">
<ContentPage.Resources>
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="StringNotNullOrEmpty_Converter"/>
<conv:BoolInverterConverter x:Key="BoolInvert_Converter"/>
</ContentPage.Resources>
<ContentPage.Content>
<ScrollView>
<Frame>
<StackLayout x:Name="ContactPageView">
<Frame>
<StackLayout>
<Label FormattedText="{Binding MaliAddressAndMotivationsText}"/>
<Button Text="{Binding MailAddressText}"
IsEnabled="{Binding IsSendMailAvailable}"
Command="{Binding OnMailRequest}"/>
</StackLayout>
<Frame
IsVisible="{Binding
Path=IsOperatorInfoAvaliable,
Converter={StaticResource BoolInvert_Converter}}">
<Label
TextType="Html"
Text="{x:Static resources:AppResources.MarkingContactNoStationInfoAvailableNoButton}"/>
</Frame>
<Frame>
<Frame
IsVisible="{Binding IsOperatorInfoAvaliable}">
<StackLayout>
<Label FormattedText="{Binding PhoneContactText}"/>
<Button Text="{Binding PhoneNumberText}"
IsEnabled="{Binding IsDoPhoncallAvailable}"
Command="{Binding OnPhoneRequest}"/>
<!--- Mail address -->
<Label
IsVisible="{Binding MailAddressText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
FormattedText="{Binding MaliAddressAndMotivationsText}"/>
<Button
x:Name="MailAddressButton"
IsVisible="{Binding MailAddressText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
Text="{Binding MailAddressText}"
IsEnabled="{Binding IsSendMailAvailable}"
Command="{Binding OnMailRequest}"/>
<!--- Mail address -->
<Label
IsVisible="{Binding PhoneNumberText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
FormattedText="{Binding PhoneContactText}"/>
<Button
x:Name="PhoneNumberButton"
IsVisible="{Binding PhoneNumberText, Converter={StaticResource StringNotNullOrEmpty_Converter}}"
Text="{Binding PhoneNumberText}"
IsEnabled="{Binding IsDoPhoncallAvailable}"
Command="{Binding OnPhoneRequest}"/>
</StackLayout>
</Frame>
<Frame>

View file

@ -16,6 +16,7 @@ namespace TINK.View.Contact
InitializeComponent ();
ContactPageView.BindingContext = new ContactPageViewModel(
App.ModelRoot.SelectedStation,
App.ModelRoot.Uris.ActiveUri,
() => App.CreateAttachment(),
() => DependencyService.Get<IExternalBrowserService>().OpenUrl(DependencyService.Get<IAppInfo>().StoreUrl),

View file

@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TINK.Model.Station;
#if USEMASTERDETAIL || USEFLYOUT
using TINK.View.MasterDetail;
#endif
@ -58,9 +55,14 @@ namespace TINK.View.Root
/// </summary>
private void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as RootPageFlyoutMenuItem;
if (item == null)
if (!(e.SelectedItem is RootPageFlyoutMenuItem item))
{
// Unexpected argument detected.
return;
}
// Set selected station to new
App.ModelRoot.SelectedStation = new NullStation();
ShowPage(item.TargetType, item.Title);

View file

@ -1,6 +1,4 @@

using System;
using System.Collections.Generic;
using TINK.ViewModel.RootShell;
using Xamarin.Forms;

View file

@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Xamarin.Forms;
using TINK.Model.User.Account;
using System.Linq;
using System.Reflection;
namespace TINK.View.Settings
{

View file

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Xamarin.Forms;
namespace TINK.View
@ -14,7 +12,7 @@ namespace TINK.View
/// <returns>Boolean value indicating whether object is visible or not.</returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (value != null && value is string text && !string.IsNullOrEmpty(text));
return value != null && value is string text && !string.IsNullOrEmpty(text);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

View file

@ -44,7 +44,7 @@ namespace TINK.View
case ViewTypes.TabbedPageInfo:
return typeof(TabbedPageInfo);
case ViewTypes.TabbedPageHelpContact:
case ViewTypes.FeesAndBikesPage:
return typeof(FeesAndBikesPage);
case ViewTypes.ManageAccountPage:
@ -59,6 +59,9 @@ namespace TINK.View
case ViewTypes.BikesAtStation:
return typeof(BikesAtStationPage);
case ViewTypes.ContactPage:
return typeof(ContactPage);
default:
return typeof(ContentPage);
}