Layout and Push Fix

This commit is contained in:
2026-03-28 23:44:56 +01:00
parent 74722b5e81
commit cf3d7557aa
13 changed files with 429 additions and 282 deletions
+82 -88
View File
@@ -8,96 +8,90 @@
Title="Monat"
BackgroundColor="{DynamicResource AppBackground}">
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Grid ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousMonthCommand}" />
<Label Grid.Column="1"
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2"
Text="→"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding NextMonthCommand}" />
</Grid>
<Grid RowDefinitions="Auto,Auto,Auto,*"
Padding="16"
RowSpacing="12">
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
</Grid>
<Grid Grid.Row="0"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="12">
<Button Text="◀"
Command="{Binding PreviousMonthCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
</Grid>
<Label Grid.Column="1"
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="22"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Margin="2"
Padding="6"
Stroke="{Binding BorderColor}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 10">
<Border.Triggers>
<DataTrigger TargetType="Border"
Binding="{Binding IsPlaceholder}"
Value="True">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="StrokeThickness" Value="0" />
</DataTrigger>
</Border.Triggers>
<Button Grid.Column="2"
Text="▶"
Command="{Binding NextMonthCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
</Grid>
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:MonthViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:MonthViewModel'}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Grid Grid.Row="1"
ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1"
Text="Export"
Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" />
</Grid>
<VerticalStackLayout Spacing="4">
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
<Border Padding="4"
IsVisible="{Binding ShowAverage}"
StrokeThickness="0"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding AverageStateText}"
FontSize="11"
HorizontalTextAlignment="Center"
TextColor="White" />
</Border>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
<Grid Grid.Row="2"
ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="6"
Padding="2,0">
<Label Text="Mo" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" TextColor="{DynamicResource TextMuted}" />
</Grid>
<CollectionView Grid.Row="3"
ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7"
VerticalItemSpacing="6"
HorizontalItemSpacing="6" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Stroke="{Binding BorderColor}"
BackgroundColor="{Binding BackgroundColor}"
StrokeShape="RoundRectangle 10"
Padding="6"
MinimumHeightRequest="58">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Grid>
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontAttributes="Bold"
FontSize="15"
TextColor="{Binding TextColor}" />
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>
+42 -11
View File
@@ -154,8 +154,23 @@
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8">
<CheckBox IsChecked="{Binding NotificationVibrationEnabled}" />
ColumnSpacing="12">
<Button Text="{Binding NotificationVibrationButtonText}"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleNotificationVibrationCommand}"
VerticalOptions="Center">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding NotificationVibrationEnabled}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<VerticalStackLayout Grid.Column="1"
Spacing="2">
<Label Text="Vibration für Push-Nachrichten"
@@ -179,16 +194,26 @@
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*,Auto,Auto"
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="8">
<TimePicker Time="{Binding SelectedTime}" />
<CheckBox Grid.Column="1"
IsChecked="{Binding IsEnabled}"
VerticalOptions="Center" />
<Label Grid.Column="2"
Text="Aktiv"
VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="1"
Text="{Binding IsEnabledButtonText}"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleIsEnabledCommand}"
VerticalOptions="Center">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsEnabled}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
@@ -207,6 +232,7 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="1"
Text="Di"
Style="{StaticResource DayToggleButtonStyle}"
@@ -222,6 +248,7 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="2"
Text="Mi"
Style="{StaticResource DayToggleButtonStyle}"
@@ -237,6 +264,7 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="3"
Text="Do"
Style="{StaticResource DayToggleButtonStyle}"
@@ -252,6 +280,7 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="4"
Text="Fr"
Style="{StaticResource DayToggleButtonStyle}"
@@ -267,6 +296,7 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="5"
Text="Sa"
Style="{StaticResource DayToggleButtonStyle}"
@@ -282,6 +312,7 @@
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="6"
Text="So"
Style="{StaticResource DayToggleButtonStyle}"
@@ -633,4 +664,4 @@
</Border>
</Grid>
</Grid>
</ContentPage>
</ContentPage>
+80 -106
View File
@@ -8,132 +8,106 @@
Title="Jahr"
BackgroundColor="{DynamicResource AppBackground}">
<Grid Padding="16"
RowSpacing="16"
RowDefinitions="Auto,Auto,*">
<Grid RowDefinitions="Auto,Auto,*"
Padding="16"
RowSpacing="12">
<Grid Grid.Row="0"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="12">
<Button Text="◀"
Command="{Binding PreviousYearCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Grid ColumnDefinitions="Auto,*,Auto"
VerticalOptions="Center">
<Button Text="←"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding PreviousYearCommand}" />
<Label Grid.Column="1"
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
Text="{Binding HeaderText}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="22"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Grid.Column="2"
Text="→"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding NextYearCommand}" />
Text="▶"
Command="{Binding NextYearCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
</Grid>
<Grid Grid.Row="1"
ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Heute"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding TodayCommand}" />
Command="{Binding TodayCommand}"
Style="{StaticResource SecondaryButtonStyle}" />
<Button Grid.Column="1"
Text="Export"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding ExportPdfCommand}" />
Command="{Binding ExportPdfCommand}"
Style="{StaticResource PrimaryButtonStyle}" />
</Grid>
<CollectionView Grid.Row="2"
ItemsSource="{Binding Months}"
SelectionMode="None"
VerticalOptions="Fill"
HorizontalOptions="Fill"
ItemSizingStrategy="MeasureAllItems">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthSectionViewModel">
<Border Padding="12"
Margin="0,0,0,12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 14">
<VerticalStackLayout Spacing="10">
<Label Text="{Binding Title}"
FontSize="18"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<ScrollView Grid.Row="2">
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Months}"
Spacing="14">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthSectionViewModel">
<Border Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 12"
Padding="10">
<VerticalStackLayout Spacing="8">
<Label Text="{Binding Title}"
FontSize="18"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="4">
<Label Text="Mo" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="1" Text="Di" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="2" Text="Mi" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="3" Text="Do" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="4" Text="Fr" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="5" Text="Sa" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
<Label Grid.Column="6" Text="So" HorizontalTextAlignment="Center" FontSize="11" TextColor="{DynamicResource TextMuted}" />
</Grid>
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None"
ItemSizingStrategy="MeasureFirstItem">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Margin="2"
Padding="4"
WidthRequest="46"
HeightRequest="46"
Stroke="{Binding BorderColor}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}"
StrokeShape="RoundRectangle 8">
<Border.Triggers>
<DataTrigger TargetType="Border"
Binding="{Binding IsPlaceholder}"
Value="True">
<Setter Property="BackgroundColor" Value="Transparent" />
<Setter Property="StrokeThickness" Value="0" />
</DataTrigger>
</Border.Triggers>
<CollectionView ItemsSource="{Binding Cells}"
SelectionMode="None">
<CollectionView.ItemsLayout>
<GridItemsLayout Orientation="Vertical"
Span="7"
VerticalItemSpacing="4"
HorizontalItemSpacing="4" />
</CollectionView.ItemsLayout>
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:YearViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:YearViewModel'}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Stroke="{Binding BorderColor}"
BackgroundColor="{Binding BackgroundColor}"
StrokeShape="RoundRectangle 8"
Padding="3"
MinimumHeightRequest="30">
<Border.GestureRecognizers>
<TapGestureRecognizer Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.OpenDayCommand}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<Grid RowDefinitions="Auto,*">
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
HorizontalTextAlignment="Center"
VerticalTextAlignment="Center"
FontSize="11"
FontAttributes="Bold"
HorizontalTextAlignment="Center"
TextColor="{Binding TextColor}" />
<Border Grid.Row="1"
IsVisible="{Binding ShowAverage}"
Margin="0,4,0,0"
Padding="2"
StrokeThickness="0"
StrokeShape="RoundRectangle 5"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding AverageStateText}"
FontSize="9"
LineBreakMode="TailTruncation"
MaxLines="1"
HorizontalTextAlignment="Center"
TextColor="White" />
</Border>
</Grid>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ContentPage>
</ContentPage>