Layout fixes and Push fixes

- Layout und Kalender angepasst
- Push status meldung angepasst für Android
This commit is contained in:
2026-03-27 11:58:53 +01:00
parent d11f0e46c0
commit 7b824b6f0c
14 changed files with 780 additions and 609 deletions
+25 -14
View File
@@ -59,28 +59,39 @@
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthCellViewModel">
<Border Margin="2"
Padding="6"
Stroke="{Binding BorderColor}"
BackgroundColor="{DynamicResource SurfaceBackground}"
StrokeShape="RoundRectangle 10">
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>
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:MonthViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:MonthViewModel'}"
CommandParameter="{Binding .}" />
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:MonthViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:MonthViewModel'}"
CommandParameter="{Binding .}" />
</Border.GestureRecognizers>
<VerticalStackLayout Spacing="4">
<Label Text="{Binding DayNumberText}"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
IsVisible="{Binding ShowDayNumber}"
FontAttributes="Bold"
TextColor="{Binding TextColor}" />
<Border Padding="4"
StrokeThickness="0"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding StateColor}">
IsVisible="{Binding ShowAverage}"
StrokeThickness="0"
StrokeShape="RoundRectangle 8"
BackgroundColor="{Binding StateColor}">
<Label Text="{Binding AverageStateText}"
FontSize="11"
HorizontalTextAlignment="Center"
TextColor="White" />
FontSize="11"
HorizontalTextAlignment="Center"
TextColor="White" />
</Border>
</VerticalStackLayout>
</Border>
+439 -442
View File
@@ -23,469 +23,466 @@
<Setter Property="TextColor" Value="{DynamicResource ButtonPrimaryText}" />
<Setter Property="BackgroundColor" Value="{DynamicResource ButtonPrimaryBackground}" />
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="LineBreakMode" Value="WordWrap" />
<Setter Property="HorizontalOptions" Value="Start" />
<Setter Property="Margin" Value="0,0,10,10" />
</Style>
</ContentPage.Resources>
<Grid>
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Label Text="Optionen"
FontSize="28"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<ScrollView>
<VerticalStackLayout Padding="16" Spacing="16">
<Label Text="Optionen"
FontSize="28"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding StatusText}"
TextColor="{DynamicResource TextMuted}" />
<Label Text="{Binding StatusText}"
TextColor="{DynamicResource TextMuted}" />
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="10">
<Button Text="Aussehen"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowAppearanceTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsAppearanceTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="1"
Text="Push-Nachrichten"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowNotificationsTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsNotificationsTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="2"
Text="Datenverwaltung"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowDataManagementTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsDataManagementTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</Grid>
</Border>
<VerticalStackLayout IsVisible="{Binding IsAppearanceTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Aussehen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<FlexLayout Direction="Row"
Wrap="Wrap"
AlignItems="Start"
JustifyContent="Start">
<Button Text="Aussehen"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowAppearanceTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsAppearanceTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Label Text="Farben werden direkt im Feld angezeigt. Über &#34;Farbe wählen&#34; öffnet sich ein einzelner Farbdialog mit Zurücksetzen, Abbrechen und Übernehmen."
TextColor="{DynamicResource TextMuted}" />
<Button Text="Push-Nachrichten"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowNotificationsTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsNotificationsTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<VerticalStackLayout x:Name="AppearanceColorsHost"
Spacing="10" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding StatusTexts}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:AppearanceTextItemViewModel">
<VerticalStackLayout Spacing="4"
Padding="0,6">
<Label Text="{Binding Title}"
TextColor="{DynamicResource TextPrimary}" />
<Entry Text="{Binding Value}" />
</VerticalStackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveAppearanceCommand}" />
<Button Grid.Column="1"
Text="Zurücksetzen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ResetAppearanceCommand}" />
</Grid>
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding IsNotificationsTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Push-Benachrichtigungen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="Ein Zeitblock kann auf mehreren Wochentagen aktiv sein."
TextColor="{DynamicResource TextMuted}" />
<Button Text="Zeit hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddScheduleCommand}" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding NotificationSchedules}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:NotificationScheduleItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*,Auto,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}" />
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="6">
<Button Text="Mo"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleMondayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Monday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="1"
Text="Di"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleTuesdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Tuesday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="2"
Text="Mi"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleWednesdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Wednesday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="3"
Text="Do"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleThursdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Thursday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="4"
Text="Fr"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleFridayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Friday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="5"
Text="Sa"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleSaturdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Saturday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="6"
Text="So"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleSundayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Sunday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</Grid>
<Button Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteScheduleCommand}"
CommandParameter="{Binding .}" />
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Button Text="Benachrichtigungszeiten speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveSchedulesCommand}" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding IsDataManagementTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Tätigkeiten"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10">
<Entry Text="{Binding NewActivityName}"
Placeholder="Neue Tätigkeit" />
<Button Grid.Column="1"
Text="Hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddActivityCommand}" />
</Grid>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Activities}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:ActivityManageItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Entry Text="{Binding Name}" />
<Label Text="{Binding UsageHint}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveActivityCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleActivityActiveCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteActivityCommand}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
<Button Text="Datenverwaltung"
Style="{StaticResource OptionsTabButtonStyle}"
Command="{Binding ShowDataManagementTabCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding IsDataManagementTabSelected}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</FlexLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Symptome"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10">
<Entry Text="{Binding NewSymptomName}"
Placeholder="Neues Symptom" />
<Button Grid.Column="1"
Text="Hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddSymptomCommand}" />
</Grid>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:SymptomManageItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Entry Text="{Binding Name}" />
<Label Text="{Binding UsageHint}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveSymptomCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleSymptomActiveCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteSymptomCommand}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Datenbank"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding CurrentDatabasePath, StringFormat='Aktiver Pfad: {0}'}"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8">
<CheckBox IsChecked="{Binding UseExternalDatabase}" />
<Label Grid.Column="1"
Text="Externe Datenbank verwenden"
VerticalOptions="Center"
<VerticalStackLayout IsVisible="{Binding IsAppearanceTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Aussehen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
<Entry Text="{Binding ExternalDatabasePath}"
Placeholder="Ordner oder Dateipfad für externe DB" />
<Label Text="Pro Farbe wird nur noch Vorschau und Dialog-Button angezeigt. Der eigentliche Farbwert wird erst im Farbdialog bearbeitet."
TextColor="{DynamicResource TextMuted}" />
<Label Text="Für SQLite ist ein externer Dateipfad sinnvoll. Für echte Mehrbenutzer-Synchronisierung ist später eher ein eigener Server oder eine API-Schicht besser geeignet."
TextColor="{DynamicResource TextMuted}" />
<VerticalStackLayout x:Name="AppearanceColorsHost"
Spacing="10" />
<Button Text="Datenbankpfad speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveDatabaseLocationCommand}" />
</VerticalStackLayout>
</Border>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding StatusTexts}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:AppearanceTextItemViewModel">
<VerticalStackLayout Spacing="4"
Padding="0,6">
<Label Text="{Binding Title}"
TextColor="{DynamicResource TextPrimary}" />
<Entry Text="{Binding Value}" />
</VerticalStackLayout>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Alle Einträge löschen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="Zum Bestätigen 'löschen' eingeben."
TextColor="{DynamicResource TextMuted}" />
<Entry Text="{Binding DeleteConfirmationText}"
Placeholder="löschen" />
<Button Text="Alles löschen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding DeleteAllDataCommand}" />
</VerticalStackLayout>
</Border>
<Grid ColumnDefinitions="*,*"
ColumnSpacing="12">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveAppearanceCommand}" />
<Button Grid.Column="1"
Text="Zurücksetzen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ResetAppearanceCommand}" />
</Grid>
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="10">
<Label Text="Export"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<VerticalStackLayout IsVisible="{Binding IsNotificationsTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Push-Benachrichtigungen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Text="Export entleeren"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearExportsCommand}" />
</VerticalStackLayout>
</Border>
<Label Text="Ein Zeitblock kann auf mehreren Wochentagen aktiv sein."
TextColor="{DynamicResource TextMuted}" />
<Button Text="Zeit hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddScheduleCommand}" />
<VerticalStackLayout BindableLayout.ItemsSource="{Binding NotificationSchedules}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:NotificationScheduleItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="*,Auto,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}" />
</Grid>
<Grid ColumnDefinitions="*,*,*,*,*,*,*"
ColumnSpacing="6">
<Button Text="Mo"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleMondayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Monday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="1"
Text="Di"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleTuesdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Tuesday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="2"
Text="Mi"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleWednesdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Wednesday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="3"
Text="Do"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleThursdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Thursday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="4"
Text="Fr"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleFridayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Friday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="5"
Text="Sa"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleSaturdayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Saturday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
<Button Grid.Column="6"
Text="So"
Style="{StaticResource DayToggleButtonStyle}"
Command="{Binding ToggleSundayCommand}">
<Button.Triggers>
<DataTrigger TargetType="Button"
Binding="{Binding Sunday}"
Value="True">
<Setter Property="BackgroundColor"
Value="{DynamicResource ButtonSecondaryBackground}" />
<Setter Property="TextColor"
Value="{DynamicResource ButtonSecondaryText}" />
</DataTrigger>
</Button.Triggers>
</Button>
</Grid>
<Button Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteScheduleCommand}"
CommandParameter="{Binding .}" />
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
<Button Text="Benachrichtigungszeiten speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveSchedulesCommand}" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
<VerticalStackLayout IsVisible="{Binding IsDataManagementTabSelected}"
Spacing="16">
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Tätigkeiten"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10">
<Entry Text="{Binding NewActivityName}"
Placeholder="Neue Tätigkeit" />
<Button Grid.Column="1"
Text="Hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddActivityCommand}" />
</Grid>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Activities}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:ActivityManageItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Entry Text="{Binding Name}" />
<Label Text="{Binding UsageHint}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveActivityCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleActivityActiveCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteActivityCommand}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Symptome"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="10">
<Entry Text="{Binding NewSymptomName}"
Placeholder="Neues Symptom" />
<Button Grid.Column="1"
Text="Hinzufügen"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding AddSymptomCommand}" />
</Grid>
<VerticalStackLayout BindableLayout.ItemsSource="{Binding Symptoms}"
Spacing="10">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="viewModels:SymptomManageItemViewModel">
<Border Padding="10"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackgroundAlt}">
<VerticalStackLayout Spacing="8">
<Entry Text="{Binding Name}" />
<Label Text="{Binding UsageHint}"
FontSize="12"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="*,*,*"
ColumnSpacing="8">
<Button Text="Speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.SaveSymptomCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="1"
Text="Aktiv/Inaktiv"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.ToggleSymptomActiveCommand}"
CommandParameter="{Binding .}" />
<Button Grid.Column="2"
Text="Entfernen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding Source={x:Reference RootPage}, Path=BindingContext.DeleteSymptomCommand}"
CommandParameter="{Binding .}" />
</Grid>
</VerticalStackLayout>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Datenbank"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="{Binding CurrentDatabasePath, StringFormat='Aktiver Pfad: {0}'}"
TextColor="{DynamicResource TextMuted}" />
<Grid ColumnDefinitions="Auto,*"
ColumnSpacing="8">
<CheckBox IsChecked="{Binding UseExternalDatabase}" />
<Label Grid.Column="1"
Text="Externe Datenbank verwenden"
VerticalOptions="Center"
TextColor="{DynamicResource TextPrimary}" />
</Grid>
<Entry Text="{Binding ExternalDatabasePath}"
Placeholder="Ordner oder Dateipfad für externe DB" />
<Label Text="Für SQLite ist ein externer Dateipfad sinnvoll. Für echte Mehrbenutzer-Synchronisierung ist später eher ein eigener Server oder eine API-Schicht besser geeignet."
TextColor="{DynamicResource TextMuted}" />
<Button Text="Datenbankpfad speichern"
Style="{StaticResource PrimaryButtonStyle}"
Command="{Binding SaveDatabaseLocationCommand}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="12">
<Label Text="Alle Einträge löschen"
FontSize="20"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Label Text="Zum Bestätigen 'löschen' eingeben."
TextColor="{DynamicResource TextMuted}" />
<Entry Text="{Binding DeleteConfirmationText}"
Placeholder="löschen" />
<Button Text="Alles löschen"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding DeleteAllDataCommand}" />
</VerticalStackLayout>
</Border>
<Border Padding="12"
Stroke="{DynamicResource Border}"
BackgroundColor="{DynamicResource SurfaceBackground}">
<VerticalStackLayout Spacing="10">
<Label Text="Export"
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<Button Text="Export entleeren"
Style="{StaticResource SecondaryButtonStyle}"
Command="{Binding ClearExportsCommand}" />
</VerticalStackLayout>
</Border>
</VerticalStackLayout>
</VerticalStackLayout>
</VerticalStackLayout>
</ScrollView>
</ScrollView>
<Grid x:Name="ColorDialogOverlay"
IsVisible="False"
+21 -74
View File
@@ -1,12 +1,9 @@
using cfs_tracker.Helpers;
using cfs_tracker.ViewModels;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Graphics;
using System;
using Microsoft.Maui.Layouts;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace cfs_tracker.Views;
@@ -103,8 +100,6 @@ public partial class OptionsPage : ContentPage
var normalizedHex = NormalizeHex(item.Value, item.Fallback);
item.Value = normalizedHex;
item.PreviewColor = ColorUtility.ParseColor(normalizedHex, item.Fallback);
var lastValidHex = normalizedHex;
var isUpdating = false;
var titleLabel = new Label
{
@@ -121,90 +116,42 @@ public partial class OptionsPage : ContentPage
};
defaultLabel.SetDynamicResource(Label.TextColorProperty, "TextMuted");
var hexEntry = new Entry
{
Placeholder = "#112233",
HorizontalOptions = LayoutOptions.Fill,
ClearButtonVisibility = ClearButtonVisibility.WhileEditing,
BindingContext = item
};
hexEntry.SetBinding(Entry.TextProperty, nameof(AppearanceColorItemViewModel.Value), mode: BindingMode.TwoWay);
var previewBox = new BoxView
{
WidthRequest = 64,
HeightRequest = 34,
CornerRadius = 6,
HorizontalOptions = LayoutOptions.Center,
WidthRequest = 84,
HeightRequest = 42,
CornerRadius = 8,
HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Center,
BindingContext = item
BindingContext = item,
Margin = new Thickness(0, 0, 10, 10)
};
previewBox.SetBinding(BoxView.ColorProperty, nameof(AppearanceColorItemViewModel.PreviewColor));
var chooseButton = new Button
{
Text = "Farbe wählen"
Text = "Farbe wählen",
LineBreakMode = LineBreakMode.WordWrap,
HorizontalOptions = LayoutOptions.Start,
VerticalOptions = LayoutOptions.Center,
Margin = new Thickness(0, 0, 0, 10)
};
chooseButton.SetDynamicResource(Button.BackgroundColorProperty, "ButtonSecondaryBackground");
chooseButton.SetDynamicResource(Button.TextColorProperty, "ButtonSecondaryText");
chooseButton.Clicked += (_, _) => OpenColorDialog(item);
var editorGrid = new Grid
var actionLayout = new FlexLayout
{
ColumnSpacing = 10,
RowSpacing = 10,
ColumnDefinitions = new ColumnDefinitionCollection
Direction = FlexDirection.Row,
Wrap = FlexWrap.Wrap,
AlignItems = FlexAlignItems.Center,
JustifyContent = FlexJustify.Start,
Children =
{
new ColumnDefinition { Width = GridLength.Star },
new ColumnDefinition { Width = new GridLength(80) },
new ColumnDefinition { Width = new GridLength(140) }
previewBox,
chooseButton
}
};
editorGrid.Add(hexEntry);
editorGrid.Add(previewBox, 1, 0);
editorGrid.Add(chooseButton, 2, 0);
if (item is INotifyPropertyChanged notify)
{
notify.PropertyChanged += (_, args) =>
{
if (args.PropertyName == nameof(AppearanceColorItemViewModel.Value))
lastValidHex = NormalizeHex(item.Value, item.Fallback);
};
}
hexEntry.TextChanged += (_, args) =>
{
if (isUpdating)
return;
var text = args.NewTextValue?.Trim() ?? string.Empty;
if (!HexColorRegex.IsMatch(text))
return;
lastValidHex = NormalizeHex(text, item.Fallback);
item.PreviewColor = ColorUtility.ParseColor(lastValidHex, item.Fallback);
};
hexEntry.Unfocused += (_, _) =>
{
var text = hexEntry.Text?.Trim() ?? string.Empty;
isUpdating = true;
if (HexColorRegex.IsMatch(text))
{
lastValidHex = NormalizeHex(text, item.Fallback);
item.Value = lastValidHex;
item.PreviewColor = ColorUtility.ParseColor(lastValidHex, item.Fallback);
}
else
{
item.Value = lastValidHex;
item.PreviewColor = ColorUtility.ParseColor(lastValidHex, item.Fallback);
}
isUpdating = false;
};
var content = new VerticalStackLayout
{
@@ -213,7 +160,7 @@ public partial class OptionsPage : ContentPage
{
titleLabel,
defaultLabel,
editorGrid
actionLayout
}
};
+34 -10
View File
@@ -47,7 +47,7 @@
SelectionMode="None"
VerticalOptions="Fill"
HorizontalOptions="Fill"
ItemSizingStrategy="MeasureFirstItem">
ItemSizingStrategy="MeasureAllItems">
<CollectionView.ItemTemplate>
<DataTemplate x:DataType="viewModels:MonthSectionViewModel">
<Border Padding="12"
@@ -61,12 +61,25 @@
FontAttributes="Bold"
TextColor="{DynamicResource TextPrimary}" />
<FlexLayout Direction="Row"
Wrap="Wrap"
AlignItems="Start"
JustifyContent="Start"
BindableLayout.ItemsSource="{Binding Cells}">
<BindableLayout.ItemTemplate>
<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"
@@ -75,6 +88,15 @@
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>
<Border.GestureRecognizers>
<TapGestureRecognizer
Command="{Binding Source={RelativeSource AncestorType={x:Type viewModels:YearViewModel}}, Path=OpenDayCommand, x:DataType='viewModels:YearViewModel'}"
@@ -83,12 +105,14 @@
<Grid RowDefinitions="Auto,*">
<Label Text="{Binding DayNumberText}"
IsVisible="{Binding ShowDayNumber}"
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"
@@ -104,12 +128,12 @@
</Grid>
</Border>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</Border>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>
</ContentPage>