sharee.bike-App/Meinkonrad/TINK/View/Bike/ILockItBike.xaml

439 lines
16 KiB
Text
Raw Normal View History

2022-09-16 11:19:46 +02:00
<?xml version="1.0" encoding="UTF-8"?>
2021-11-07 19:42:59 +01:00
<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
2023-11-21 15:26:57 +01:00
xmlns:conv="clr-namespace:TINK.View;assembly=TINKLib"
2021-11-07 19:42:59 +01:00
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
2022-08-30 15:42:25 +02:00
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
2021-11-07 19:42:59 +01:00
mc:Ignorable="d"
x:Class="TINK.View.Bike.ILockItBike">
<ContentView>
2023-05-11 17:39:28 +02:00
2021-11-07 19:42:59 +01:00
<ContentView.Resources>
2023-08-31 12:31:38 +02:00
<conv:StringNotNullOrEmptyToVisibleConverter x:Key="Label_Converter"/>
<conv:BoolInverterConverter x:Key="BoolInverterConverter"/>
<x:String x:Key="InfoCircle">&#xf05a;</x:String>
<x:String x:Key="LocationPin">&#xf3c5;</x:String>
<x:String x:Key="CityPin">&#xf64f;</x:String>
<x:String x:Key="ArrowReturnBack">&#xf0e2;</x:String>
</ContentView.Resources>
2023-04-19 12:14:14 +02:00
2023-03-08 13:18:54 +01:00
<Frame
2023-09-22 11:38:42 +02:00
Padding="10"
Margin="0,10,0,5"
HasShadow="False"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"
BackgroundColor="White">
2023-03-08 13:18:54 +01:00
<StackLayout
Orientation="Vertical"
Padding="10">
2023-04-19 12:14:14 +02:00
<!-- Icons, Name, ID, ... -->
<Grid
Padding="0"
RowSpacing="15"
ColumnSpacing="5"
2023-11-06 12:23:09 +01:00
ColumnDefinitions="Auto,*,Auto"
2023-04-19 12:14:14 +02:00
RowDefinitions="Auto,Auto,Auto">
2023-03-08 13:18:54 +01:00
2023-04-19 12:14:14 +02:00
<!-- Bike image -->
2023-03-08 13:18:54 +01:00
<Image
2023-04-19 12:14:14 +02:00
Grid.Column="0"
Grid.Row="0"
Grid.RowSpan="2"
VerticalOptions="End"
2023-11-06 12:23:09 +01:00
HorizontalOptions="Start"
2023-04-19 12:14:14 +02:00
Source="{Binding DisplayedBikeImageSourceString}"
HeightRequest="60"
Aspect="AspectFit"/>
<!-- Battery level image -->
<sharedGui:BarLevelView
Grid.Column="1"
Grid.Row="0"
Grid.RowSpan="2"
VerticalOptions="End"
2023-11-06 12:23:09 +01:00
HorizontalOptions="Start"
2023-04-19 12:14:14 +02:00
Current="{Binding CurrentChargeBars}"
Maximum="{Binding MaxChargeBars}"
IsVisible="{Binding IsBatteryChargeVisible}"/>
<!-- Rental state and error -->
<StackLayout
2023-03-08 13:18:54 +01:00
Grid.Column="0"
2023-04-19 12:14:14 +02:00
Grid.ColumnSpan="2"
Grid.Row="2"
Spacing="0"
Orientation="Vertical"
2023-03-08 13:18:54 +01:00
HorizontalOptions="Start"
2023-04-19 12:14:14 +02:00
VerticalOptions="End">
2023-03-08 13:18:54 +01:00
2023-04-19 12:14:14 +02:00
<!-- Rental state -->
<Label
Text="{Binding StateText}"
FontSize="Small"
2023-11-06 12:23:09 +01:00
LineBreakMode="WordWrap"
2023-04-19 12:14:14 +02:00
TextColor="{Binding StateColor}"/>
<!-- Rental state error info -->
<Label
Text="{Binding ErrorText}"
FontSize="Small"
2023-11-06 12:23:09 +01:00
LineBreakMode="WordWrap"
2023-04-19 12:14:14 +02:00
IsVisible="{Binding ErrorText, Converter={StaticResource Label_Converter}}"
TextColor="Red"/>
2023-03-08 13:18:54 +01:00
2023-04-19 12:14:14 +02:00
</StackLayout>
<!-- Name and Id of the bike -->
<StackLayout
2023-03-08 13:18:54 +01:00
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="0"
2023-04-19 12:14:14 +02:00
Orientation="Vertical"
VerticalOptions="Start"
HorizontalOptions="End"
Spacing="0">
<!-- Name -->
<Label
FontAttributes="Bold"
FontSize="Large"
TextColor="Black"
HorizontalTextAlignment="Right"
Text="{Binding Name}"/>
2023-03-08 13:18:54 +01:00
2023-04-19 12:14:14 +02:00
<!-- Id -->
<Label
TextColor="DimGray"
FontAttributes="Bold"
HorizontalTextAlignment="Right"
IsVisible="{Binding DisplayId, Converter={StaticResource Label_Converter}}"
Text="{Binding DisplayId}"/>
</StackLayout>
<!-- AaAbRideType -->
<StackLayout
2023-03-08 13:18:54 +01:00
Grid.Column="2"
Grid.Row="1"
2023-04-19 12:14:14 +02:00
Grid.RowSpan="2"
Spacing="0"
HorizontalOptions="End"
2023-08-31 12:31:38 +02:00
VerticalOptions="End">
2023-04-19 12:14:14 +02:00
<StackLayout
2023-08-31 12:31:38 +02:00
Spacing="0"
IsVisible="{Binding AaRideType}">
<StackLayout.Triggers>
<DataTrigger TargetType="StackLayout"
Binding="{Binding Path=IsVisible}"
Value="false">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</StackLayout.Triggers>
<StackLayout
Orientation="Horizontal"
HorizontalOptions="End">
<Image>
<Image.Source>
<FontImageSource
Glyph="{StaticResource LocationPin}"
Color="Black"
FontFamily="FA-S"
Size="20"/>
</Image.Source>
</Image>
<Image>
<Image.Source>
<FontImageSource
Glyph="{StaticResource ArrowReturnBack}"
Color="Black"
FontFamily="FA-S"
Size="20"/>
</Image.Source>
</Image>
<Button
Command="{Binding ShowRideTypeInfoCommand}"
WidthRequest="24"
HeightRequest="24"
BackgroundColor="Transparent"
BorderWidth="0"
Padding="0"
Margin="5,0,0,0">
<Button.ImageSource>
<FontImageSource
Glyph="{StaticResource InfoCircle}"
Color="DimGray"
FontFamily="FA-S"
Size="20"/>
</Button.ImageSource>
</Button>
</StackLayout>
<Label
2023-04-19 12:14:14 +02:00
Text= "{Binding StationId}"
FontSize="Small"
HorizontalOptions="End"/>
2023-08-31 12:31:38 +02:00
</StackLayout>
<!-- BikeIsBoundToCityArea -->
<!-- later, when value comes from backend: IsVisible="{Binding CityAreaType}"-->
<StackLayout
Spacing="0"
IsVisible="{Binding IsBikeBoundToCity}">
<StackLayout.Triggers>
<DataTrigger TargetType="StackLayout"
Binding="{Binding Path=IsVisible}"
Value="false">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</StackLayout.Triggers>
<StackLayout
Orientation="Horizontal"
HorizontalOptions="End">
<Image>
<Image.Source>
<FontImageSource
Glyph="{StaticResource CityPin}"
Color="Black"
FontFamily="FA-S"
Size="20"/>
</Image.Source>
</Image>
<Image>
<Image.Source>
<FontImageSource
Glyph="{StaticResource ArrowReturnBack}"
Color="Black"
FontFamily="FA-S"
Size="20"/>
</Image.Source>
</Image>
<Button
Command="{Binding ShowBikeIsBoundToCityInfoCommand}"
WidthRequest="24"
HeightRequest="24"
BackgroundColor="Transparent"
BorderWidth="0"
Padding="0"
Margin="5,0,0,0">
<Button.ImageSource>
<FontImageSource
Glyph="{StaticResource InfoCircle}"
Color="DimGray"
FontFamily="FA-S"
Size="20"/>
</Button.ImageSource>
</Button>
</StackLayout>
<Label
Text="{x:Static resources:AppResources.MarkingBikeIsBoundToCity}"
FontSize="Small"
HorizontalOptions="End"/>
</StackLayout>
2023-04-19 12:14:14 +02:00
</StackLayout>
2023-03-08 13:18:54 +01:00
</Grid>
<!-- Buttons -->
<Button
2023-04-19 12:14:14 +02:00
Text="{Binding ButtonText}"
IsVisible="{Binding IsButtonVisible}"
Command="{Binding OnButtonClicked}"/>
2023-03-08 13:18:54 +01:00
<Button
2023-04-19 12:14:14 +02:00
Style="{StaticResource SecondaryButton}"
Text="{Binding LockitButtonText}"
IsVisible="{Binding IsLockitButtonVisible}"
Command="{Binding OnLockitButtonClicked}"/>
2023-03-08 13:18:54 +01:00
<!-- Rental description (tarif name, options and rental info -->
<Grid
2023-04-19 12:14:14 +02:00
RowSpacing="0"
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}">
2023-03-08 13:18:54 +01:00
<Grid.RowDefinitions>
<!-- start tarif- entries -->
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<!-- start rental info -->
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
2022-06-17 14:17:58 +02:00
2023-03-08 13:18:54 +01:00
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
2023-04-19 12:14:14 +02:00
<ColumnDefinition Width="Auto" />
2023-03-08 13:18:54 +01:00
</Grid.ColumnDefinitions>
2023-04-19 12:14:14 +02:00
2023-03-08 13:18:54 +01:00
<!-- start tarif- entries (should be a CollectionView) -->
<Label
2023-04-19 12:14:14 +02:00
Text= "{x:Static resources:AppResources.MessageBikesManagementTariffDescriptionTariffHeader}"
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
Grid.Row="0"
FontAttributes="Bold"/>
2023-03-08 13:18:54 +01:00
<Label
2023-04-19 12:14:14 +02:00
Text="{Binding TariffDescription.Header}"
IsVisible="{Binding TariffDescription.Header, Converter={StaticResource Label_Converter}}"
Grid.Row="0"
Grid.Column="1"
FontAttributes="Bold"/>
<!--Tracking-->
<Grid
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2"
ColumnDefinitions="*,Auto"
IsVisible="{Binding TariffDescription.TrackingInfoText, Converter={StaticResource Label_Converter}}">
<Label
Text= "Tracking"
Grid.Column="0"
HorizontalOptions="End"/>
<Button
Command="{Binding ShowTrackingInfoCommand}"
WidthRequest="24"
HeightRequest="24"
BackgroundColor="Transparent"
BorderWidth="0"
Grid.Column="1"
Padding="0"
Margin="0">
<Button.ImageSource>
<FontImageSource
Glyph="{StaticResource InfoCircle}"
Color="DimGray"
FontFamily="FA-S"
Size="20"/>
</Button.ImageSource>
</Button>
</Grid>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry1.Description}"
IsVisible="{Binding TariffDescription.TarifEntry1.Description, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="1"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry1.Value}"
IsVisible="{Binding TariffDescription.TarifEntry1.Value, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="1"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry2.Description}"
IsVisible="{Binding TariffDescription.TarifEntry2.Description, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry2.Value}"
IsVisible="{Binding TariffDescription.TarifEntry2.Value, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="2"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry3.Description}"
IsVisible="{Binding TariffDescription.TarifEntry3.Description, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="3"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry3.Value}"
IsVisible="{Binding TariffDescription.TarifEntry3.Value, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="3"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry4.Description}"
IsVisible="{Binding TariffDescription.TarifEntry4.Description, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="4"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry4.Value}"
IsVisible="{Binding TariffDescription.TarifEntry4.Value, Converter={StaticResource Label_Converter}}"
2021-11-07 19:42:59 +01:00
Grid.Row="4"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry5.Description}"
IsVisible="{Binding TariffDescription.TarifEntry5.Description, Converter={StaticResource Label_Converter}}"
Grid.Row="5"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry5.Value}"
IsVisible="{Binding TariffDescription.TarifEntry5.Value, Converter={StaticResource Label_Converter}}"
Grid.Row="5"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry6.Description}"
IsVisible="{Binding TariffDescription.TarifEntry6.Description, Converter={StaticResource Label_Converter}}"
Grid.Row="6"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry6.Value}"
IsVisible="{Binding TariffDescription.TarifEntry6.Value, Converter={StaticResource Label_Converter}}"
Grid.Row="6"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry7.Description}"
IsVisible="{Binding TariffDescription.TarifEntry7.Description, Converter={StaticResource Label_Converter}}"
Grid.Row="7"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry7.Value}"
IsVisible="{Binding TariffDescription.TarifEntry7.Value, Converter={StaticResource Label_Converter}}"
Grid.Row="7"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry8.Description}"
IsVisible="{Binding TariffDescription.TarifEntry8.Description, Converter={StaticResource Label_Converter}}"
Grid.Row="8"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry8.Value}"
IsVisible="{Binding TariffDescription.TarifEntry8.Value, Converter={StaticResource Label_Converter}}"
Grid.Row="8"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.TarifEntry9.Description}"
IsVisible="{Binding TariffDescription.TarifEntry9.Description, Converter={StaticResource Label_Converter}}"
Grid.Row="9"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text="{Binding TariffDescription.TarifEntry9.Value}"
IsVisible="{Binding TariffDescription.TarifEntry9.Value, Converter={StaticResource Label_Converter}}"
Grid.Row="9"
2023-04-19 12:14:14 +02:00
Grid.Column="1"
Grid.ColumnSpan="2"/>
2023-03-08 13:18:54 +01:00
<!-- start tarif- entries (should be a CollectionView) -->
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.InfoEntry1}"
IsVisible="{Binding TariffDescription.InfoEntry1, Converter={StaticResource Label_Converter}}"
Grid.Row="10"
2023-04-19 12:14:14 +02:00
Grid.ColumnSpan="3"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.InfoEntry2}"
IsVisible="{Binding TariffDescription.InfoEntry2, Converter={StaticResource Label_Converter}}"
Grid.Row="11"
2023-04-19 12:14:14 +02:00
Grid.ColumnSpan="3"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.InfoEntry3}"
IsVisible="{Binding TariffDescription.InfoEntry3, Converter={StaticResource Label_Converter}}"
Grid.Row="12"
2023-04-19 12:14:14 +02:00
Grid.ColumnSpan="3"/>
2023-03-08 13:18:54 +01:00
<Label
2022-06-17 14:17:58 +02:00
Text= "{Binding TariffDescription.InfoEntry4}"
IsVisible="{Binding TariffDescription.InfoEntry4, Converter={StaticResource Label_Converter}}"
Grid.Row="13"
2023-04-19 12:14:14 +02:00
Grid.ColumnSpan="3"/>
2023-03-08 13:18:54 +01:00
</Grid>
</StackLayout>
</Frame>
</ContentView>
2022-09-16 11:19:46 +02:00
</ViewCell>