Files
ulapp/FieldLogger/Views/JobsPage.xaml
2026-08-23 20:54:03 -05:00

116 lines
8.0 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:vm="clr-namespace:FieldLogger.ViewModels"
xmlns:controls="clr-namespace:FieldLogger.Views.Controls"
x:Class="FieldLogger.Views.JobsPage"
x:DataType="vm:JobsViewModel"
Title="Jobs"
Shell.NavBarIsVisible="False"
BackgroundColor="{DynamicResource UlColorCanvas}">
<Grid RowDefinitions="Auto,*"
HorizontalOptions="Fill" VerticalOptions="Fill">
<controls:AppStatusBar x:Name="AppStatus" />
<Grid Grid.Row="1" RowDefinitions="Auto,Auto,*" Padding="16" RowSpacing="16"
HorizontalOptions="Fill" VerticalOptions="Fill">
<VerticalStackLayout Spacing="4">
<Label Text="FIELD WORK" FontSize="14" FontAttributes="Bold" CharacterSpacing="1.5"
TextColor="{DynamicResource UlColorPrimary}" />
<Label Text="Jobs" Style="{StaticResource UlPageTitle}"
TextColor="{DynamicResource UlColorText}"
SemanticProperties.HeadingLevel="Level1" />
<Label Text="Choose the active job before capturing points."
FontSize="16" TextColor="{DynamicResource UlColorTextMuted}" />
</VerticalStackLayout>
<Button Grid.Row="1" Style="{StaticResource UlButtonPrimaryField}"
Text=" Create new job" Command="{Binding NewJobCommand}"
MinimumHeightRequest="{StaticResource UlTouchComfortable}" FontSize="16" FontAttributes="Bold"
SemanticProperties.Description="Create a new job and make it active" />
<RefreshView Grid.Row="2"
Command="{Binding RefreshCommand}"
IsRefreshing="{Binding IsRefreshing, Mode=OneWay}"
HorizontalOptions="Fill" VerticalOptions="Fill">
<CollectionView ItemsSource="{Binding Jobs}"
SelectionMode="None"
ItemSizingStrategy="MeasureFirstItem"
ItemsUpdatingScrollMode="KeepItemsInView"
HorizontalOptions="Fill" VerticalOptions="Fill"
SemanticProperties.Description="Jobs available on this device">
<CollectionView.EmptyView>
<Border Style="{StaticResource UlCard}" BackgroundColor="{DynamicResource UlColorSurfaceRaised}"
Stroke="{DynamicResource UlColorBorder}"
StrokeShape="RoundRectangle 12" Padding="24">
<VerticalStackLayout Spacing="8" VerticalOptions="Center">
<Label Text="No jobs yet" Style="{StaticResource UlEmptyStateTitle}"
HorizontalTextAlignment="Center" TextColor="{DynamicResource UlColorText}" />
<Label Text="Create a job to establish the capture context."
Style="{StaticResource UlEmptyStateBody}"
FontSize="16" HorizontalTextAlignment="Center"
TextColor="{DynamicResource UlColorTextMuted}" />
<Button Style="{StaticResource UlButtonPrimary}"
Text="Create first job" Command="{Binding NewJobCommand}"
MinimumHeightRequest="{StaticResource UlTouchComfortable}" HorizontalOptions="Fill"
SemanticProperties.Description="Create the first job" />
</VerticalStackLayout>
</Border>
</CollectionView.EmptyView>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="vm:JobListItem">
<Border Style="{StaticResource UlJobRow}" BackgroundColor="{DynamicResource UlColorSurfaceRaised}"
Stroke="{DynamicResource UlColorBorder}"
StrokeThickness="1" StrokeShape="RoundRectangle 12"
Padding="16" Margin="0,0,0,12" MinimumHeightRequest="136"
SemanticProperties.Description="{Binding AccessibilityDescription}"
SemanticProperties.Hint="Double tap to open job details">
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding OpenCommand, Source={RelativeSource AncestorType={x:Type vm:JobsViewModel}}}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="*,Auto" RowSpacing="8" ColumnSpacing="12">
<Label Text="{Binding Name}" FontSize="20" FontAttributes="Bold"
TextColor="{DynamicResource UlColorText}" LineBreakMode="TailTruncation" />
<Border Grid.Column="1" Style="{StaticResource UlStatusBadge}"
BackgroundColor="{DynamicResource UlColorCanvas}"
Stroke="{DynamicResource UlColorBorder}"
StrokeShape="RoundRectangle 8" Padding="8,4">
<Label Text="{Binding ActiveStatusLabel}" FontSize="14" FontAttributes="Bold"
TextColor="{DynamicResource UlColorText}" />
</Border>
<Label Grid.Row="1" Grid.ColumnSpan="2" Text="{Binding JobSummary}"
FontSize="16" TextColor="{DynamicResource UlColorTextMuted}" />
<Grid Grid.Row="2" Grid.ColumnSpan="2" ColumnDefinitions="*,*" ColumnSpacing="8">
<Button Style="{StaticResource UlButtonSecondary}"
Text="{Binding ActiveActionLabel}"
IsEnabled="{Binding IsActive, Converter={StaticResource InvertBool}}"
Command="{Binding SetActiveCommand, Source={RelativeSource AncestorType={x:Type vm:JobsViewModel}}}"
CommandParameter="{Binding .}" MinimumHeightRequest="{StaticResource UlTouchMinimum}"
SemanticProperties.Description="{Binding ActiveActionDescription}" />
<Button Grid.Column="1" Style="{StaticResource UlButtonAccent}"
Text="Delete job"
BackgroundColor="{DynamicResource UlColorAccent}"
TextColor="{DynamicResource UlColorOnAccent}"
Command="{Binding DeleteCommand, Source={RelativeSource AncestorType={x:Type vm:JobsViewModel}}}"
CommandParameter="{Binding .}" MinimumHeightRequest="{StaticResource UlTouchMinimum}"
SemanticProperties.Description="{Binding DeleteDescription}" />
</Grid>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
<CollectionView.Footer>
<!-- Keeps the final row scrollable above the overlaid menu without
reserving a permanent bottom band in the page layout. -->
<ContentView HeightRequest="72" />
</CollectionView.Footer>
</CollectionView>
</RefreshView>
</Grid>
<controls:FloatingMenuButton Grid.RowSpan="2" HorizontalOptions="End" VerticalOptions="End" ZIndex="20" />
</Grid>
</ContentPage>