sharee.bike-App/TINK/TINK/View/BikesAtStation/BikesAtStationPage.xaml

196 lines
5.1 KiB
Plaintext
Raw Normal View History

2022-09-16 11:19:46 +02:00
<?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"
xmlns:resources="clr-namespace:TINK.MultilingualResources;assembly=TINKLib"
2022-09-22 20:58:30 +02:00
xmlns:sharedGui="clr-namespace:ShareeSharedGuiLib.View"
Shell.FlyoutBehavior="Disabled"
2023-03-08 13:18:54 +01:00
BackgroundColor="{DynamicResource background-color}"
2022-09-22 20:58:30 +02:00
Shell.NavBarIsVisible="{Binding IsIdle}">
2023-01-18 14:22:51 +01:00
2022-09-16 11:19:46 +02:00
<Shell.TitleView>
<Grid ColumnDefinitions="Auto, 1*">
<Label Style="{StaticResource Label-Navbar}"
Text="{Binding Title}"/>
</Grid>
</Shell.TitleView>
2023-01-18 14:22:51 +01:00
2022-09-16 11:19:46 +02:00
<ContentPage.Resources>
<ResourceDictionary>
<local_bike:BikeViewCellTemplateSelector x:Key="bikeTemplateSelector"/>
</ResourceDictionary>
</ContentPage.Resources>
2022-12-07 16:54:52 +01:00
2022-09-16 11:19:46 +02:00
<ContentPage.Content>
2022-12-07 16:54:52 +01:00
<!--Grid for Bike(s) view and Running process in same row-->
<Grid>
2023-02-22 14:03:35 +01:00
<!-- Grid for Content -->
2023-03-08 13:18:54 +01:00
<Grid
Grid.Row="0"
RowSpacing="0"
2023-07-04 11:06:38 +02:00
RowDefinitions="1*,Auto">
2023-02-22 14:03:35 +01:00
<StackLayout
2022-12-07 16:54:52 +01:00
Grid.Row="0"
2023-02-22 14:03:35 +01:00
Spacing="0"
2022-12-07 16:54:52 +01:00
Orientation="Vertical">
2023-02-22 14:03:35 +01:00
<!--Station-->
<StackLayout
2023-03-08 13:18:54 +01:00
BackgroundColor="{DynamicResource primary-back-title-color}"
IsVisible="{Binding IsIdle}"
Padding="20,0,20,0">
2022-12-07 16:54:52 +01:00
<!--Line-->
<BoxView
2023-03-08 13:18:54 +01:00
HeightRequest="1"
WidthRequest="400"
HorizontalOptions="Center"
Color="White"/>
<Grid
ColumnDefinitions="Auto,1*"
RowDefinitions="Auto"
Padding="0,0,0,5">
2023-07-04 11:06:38 +02:00
<!--Station id-->
<Label
2023-03-08 13:18:54 +01:00
Grid.Column="0"
Grid.Row="0"
FontSize="Small"
HorizontalOptions="Start"
TextColor="White"
Text="{Binding StationDetailText}"/>
2023-07-04 11:06:38 +02:00
<!--Contact to operator-->
<Label
2023-03-08 13:18:54 +01:00
Grid.Column="1"
Grid.Row="0"
TextType="Html"
FontSize="Small"
HorizontalOptions="End"
TextColor="White"
Text="{Binding ContactSupportHintText}">
2023-07-04 11:06:38 +02:00
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ContactSupportClickedCommand}"/>
</Label.GestureRecognizers>
</Label>
2023-03-08 13:18:54 +01:00
</Grid>
2022-12-07 16:54:52 +01:00
</StackLayout>
2023-07-04 11:06:38 +02:00
<!--If Not Connected To Internet-->
2023-02-22 14:03:35 +01:00
<sharedGui:NotConnectedToNetView/>
2023-07-04 11:06:38 +02:00
<!--Bike data-->
<Grid
2023-07-19 10:10:36 +02:00
RowDefinitions="Auto,1*"
2023-07-04 11:06:38 +02:00
RowSpacing="0">
2023-02-22 14:03:35 +01:00
<!--Hint for Outdated Data.-->
2023-07-04 11:06:38 +02:00
<sharedGui:HintForRefreshingPageView
Grid.Row="0"/>
<!--No Bikes-->
<Label
Grid.Row="1"
Margin="20"
IsVisible="{Binding IsNoBikesAtStationVisible}"
Text="{Binding NoBikesAtStationText}"/>
2023-02-22 14:03:35 +01:00
2023-07-04 11:06:38 +02:00
<!--Bike(s)-->
2023-03-08 13:18:54 +01:00
<ListView
Grid.Row="1"
x:Name="BikesAtStationListView"
SelectionMode="None"
SelectedItem="{Binding SelectedBike}"
IsEnabled="{Binding IsIdle}"
HasUnevenRows="True"
SeparatorVisibility="None"
ItemTemplate="{StaticResource bikeTemplateSelector}"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding RefreshCommand}"
IsRefreshing="{Binding IsRefreshing}"/>
2023-07-04 11:06:38 +02:00
</Grid>
2023-02-22 14:03:35 +01:00
</StackLayout>
2023-03-08 13:18:54 +01:00
<!--Info at End of Page-->
2023-02-22 14:03:35 +01:00
<StackLayout
2023-07-04 11:06:38 +02:00
Grid.Row="1"
2023-02-22 14:03:35 +01:00
Orientation="Vertical"
2023-03-08 13:18:54 +01:00
Spacing="0"
Padding="20,0,20,0">
2023-02-22 14:03:35 +01:00
2022-12-07 16:54:52 +01:00
<!--Info text-->
<Label
Text="{Binding StatusInfoText}"
2023-01-18 14:22:51 +01:00
IsVisible="{Binding Path=IsProcessWithRunningProcessView, Converter={StaticResource InvertedBoolConverter}}"
2022-12-07 16:54:52 +01:00
FontSize="Small"
2023-03-08 13:18:54 +01:00
TextColor="DimGray"
Padding="5"
HorizontalOptions="CenterAndExpand">
<Label.Triggers>
<DataTrigger
TargetType="Label"
Binding="{Binding Path=StatusInfoText.Length}" Value="0">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
<DataTrigger
TargetType="Label"
Binding="{Binding Path=StatusInfoText}" Value="Offline.">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</Label.Triggers>
</Label>
<!--Login-->
<StackLayout Spacing="0">
<StackLayout.Triggers>
<DataTrigger TargetType="StackLayout"
Binding="{Binding IsLoginRequiredHintVisible}"
Value="false">
<Setter Property="HeightRequest" Value="0" />
</DataTrigger>
</StackLayout.Triggers>
<!--Line-->
<BoxView
2022-12-07 16:54:52 +01:00
HeightRequest="1"
2023-03-08 13:18:54 +01:00
WidthRequest="400"
2023-02-22 14:03:35 +01:00
HorizontalOptions="Center"
2023-03-08 13:18:54 +01:00
IsVisible="{Binding IsLoginRequiredHintVisible}"
Color="DimGray" />
2022-09-16 11:19:46 +02:00
2023-03-08 13:18:54 +01:00
<!--Login required-->
<Label
2022-09-16 11:19:46 +02:00
IsVisible="{Binding IsLoginRequiredHintVisible}"
TextType="Html"
2023-03-08 13:18:54 +01:00
TextColor="DimGray"
2022-09-16 11:19:46 +02:00
Text="{Binding LoginRequiredHintText}">
2023-03-08 13:18:54 +01:00
<Label.GestureRecognizers>
<TapGestureRecognizer Command="{Binding LoginRequiredHintClickedCommand}"/>
</Label.GestureRecognizers>
</Label>
</StackLayout>
2022-12-07 16:54:52 +01:00
2023-02-22 14:03:35 +01:00
</StackLayout>
2022-12-07 16:54:52 +01:00
2023-02-22 14:03:35 +01:00
</Grid>
2022-12-07 16:54:52 +01:00
<!--While process is running-->
<sharedGui:RunningProcessView
2023-01-18 14:22:51 +01:00
IsVisible="{Binding IsProcessWithRunningProcessView}"
2022-12-07 16:54:52 +01:00
Grid.Row="0"/>
</Grid>
2022-09-16 11:19:46 +02:00
</ContentPage.Content>
2022-12-07 16:54:52 +01:00
2022-09-16 11:19:46 +02:00
</ContentPage>