Anpassungen für 1.0.8

Farbe StatusBar für Dark/Light-Mode angepasst
Loginseite optimiert
Bugfix Toast für Windows
Versionskontrolle für Windows optimiert
This commit is contained in:
2025-02-23 17:25:59 +01:00
parent 2f0be4cc5c
commit 1b4f73a913
10 changed files with 90 additions and 33 deletions

View File

@@ -5,13 +5,11 @@
/// </summary> /// </summary>
public partial class App : Application { public partial class App : Application {
/// <summary> /// <summary>
/// Initialisiert eine neue Instanz der <see cref="App"/>-Klasse. /// Initialisiert eine neue Instanz der <see cref="App"/>-Klasse.
/// </summary> /// </summary>
public App() { public App() {
InitializeComponent(); InitializeComponent();
MainPage = new AppShell();
MainPage = new AppShell(); }
}
} }

View File

@@ -15,7 +15,9 @@ public static class MauiProgram {
builder builder
.UseMauiApp<App>() .UseMauiApp<App>()
// Initialize the .NET MAUI Community Toolkit by adding the below line of code // Initialize the .NET MAUI Community Toolkit by adding the below line of code
.UseMauiCommunityToolkit() .UseMauiCommunityToolkit(options => {
options.SetShouldEnableSnackbarOnWindows(true);
})
.ConfigureFonts(fonts => { .ConfigureFonts(fonts => {
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#512BD4</color> <color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#F7931D</color> <color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color> <color name="colorAccent">#2B0B98</color>
</resources> </resources>

View File

@@ -4,7 +4,9 @@
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap"> xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10"
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10"
IgnorableNamespaces="uap rescap com desktop">
<Identity Name="JugenddienstStunden" Publisher="CN=User Name" Version="0.0.0.0" /> <Identity Name="JugenddienstStunden" Publisher="CN=User Name" Version="0.0.0.0" />
@@ -36,6 +38,26 @@
<uap:DefaultTile Square71x71Logo="Resources\Windows\Small\$placeholder$.png" Wide310x150Logo="Resources\Windows\Wide\$placeholder$.png" Square310x310Logo="Resources\Windows\$placeholder$.png" ShortName="Stunden"/> <uap:DefaultTile Square71x71Logo="Resources\Windows\Small\$placeholder$.png" Wide310x150Logo="Resources\Windows\Wide\$placeholder$.png" Square310x310Logo="Resources\Windows\$placeholder$.png" ShortName="Stunden"/>
<uap:SplashScreen Image="Resources\Windows\Splash\$placeholder$.png" BackgroundColor="#F7931D"/> <uap:SplashScreen Image="Resources\Windows\Splash\$placeholder$.png" BackgroundColor="#F7931D"/>
</uap:VisualElements> </uap:VisualElements>
<Extensions>
<!-- Specify which CLSID to activate when notification is clicked -->
<desktop:Extension Category="windows.toastNotificationActivation">
<desktop:ToastNotificationActivation ToastActivatorCLSID="6e919706-2634-4d97-a93c-2213b2acc334" />
</desktop:Extension>
<!-- Register COM CLSID -->
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:ExeServer Executable="Jugenddienst Stunden.exe" DisplayName="$targetnametoken$" Arguments="----AppNotificationActivated:">
<!-- Example path to executable: CommunityToolkit.Maui.Sample\CommunityToolkit.Maui.Sample.exe -->
<com:Class Id="6e919706-2634-4d97-a93c-2213b2acc334" />
</com:ExeServer>
</com:ComServer>
</com:Extension>
</Extensions>
</Application> </Application>
</Applications> </Applications>

View File

@@ -203,9 +203,10 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
try { try {
BaseResponse dat = await HoursBase.LoadBase("hours&year="+ DateToday.ToString("yyyy") + "&month=" + DateToday.ToString("MM")); BaseResponse dat = await HoursBase.LoadBase("hours&year="+ DateToday.ToString("yyyy") + "&month=" + DateToday.ToString("MM"));
_hour = dat.hour; _hour = dat.hour;
Settings = dat.settings;
if (dat.settings.Version != AppInfo.Current.VersionString) { if (Settings.Version != AppInfo.Current.VersionString.Substring(0,5)) {
InfoEvent?.Invoke(this, "Du solltest deine Programmversion: " + AppInfo.Current.VersionString + " auf Version: " + dat.settings.Version + " updaten"); InfoEvent?.Invoke(this, "Update verfügbar: " + AppInfo.Current.VersionString.Substring(0, 5) + " < " + dat.settings.Version + " updaten");
} }
//_hour = await HoursBase.LoadData(); //_hour = await HoursBase.LoadData();
RefreshProperties(); RefreshProperties();
@@ -260,8 +261,8 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
DayTimes = new List<DayTime>(); DayTimes = new List<DayTime>();
//TODO: hier könnte auch ein Fehler kommen, dann wäre InfoEvent falsch. //TODO: hier könnte auch ein Fehler kommen, dann wäre InfoEvent falsch.
if (Settings.Version != AppInfo.Current.VersionString) { if (Settings.Version != AppInfo.Current.VersionString.Substring(0, 5)) {
InfoEvent?.Invoke(this, "Du solltest deine Programmversion: " + AppInfo.Current.VersionString + " auf Version: " + Settings.Version + " updaten"); InfoEvent?.Invoke(this, "Update verfügbar: " + AppInfo.Current.VersionString.Substring(0, 5) + " < " + Settings.Version + " updaten");
} else { InfoEvent?.Invoke(this, e.Message); } } else { InfoEvent?.Invoke(this, e.Message); }
} finally { } finally {
OnPropertyChanged(nameof(DayTotal)); OnPropertyChanged(nameof(DayTotal));
@@ -270,7 +271,6 @@ internal partial class StundenViewModel : ObservableObject, IQueryAttributable,
OnPropertyChanged(nameof(LoadOverview)); OnPropertyChanged(nameof(LoadOverview));
//OnPropertyChanged(nameof(DayTimes)); //OnPropertyChanged(nameof(DayTimes));
} }
} }
async void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, object> query) { async void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, object> query) {

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:viewModels="clr-namespace:Jugenddienst_Stunden.ViewModels" xmlns:viewModels="clr-namespace:Jugenddienst_Stunden.ViewModels"
x:Class="Jugenddienst_Stunden.Views.AllNotesPage" x:Class="Jugenddienst_Stunden.Views.AllNotesPage"
Title="Deine Notizen" Title="Deine Notizen"
@@ -15,6 +16,12 @@
<ToolbarItem Text="Neue Notiz" Command="{Binding NewCommand}" IconImageSource="{FontImage Glyph='+', Color=Black, Size=22}" /> <ToolbarItem Text="Neue Notiz" Command="{Binding NewCommand}" IconImageSource="{FontImage Glyph='+', Color=Black, Size=22}" />
</ContentPage.ToolbarItems> </ContentPage.ToolbarItems>
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
StatusBarStyle="LightContent" />
</ContentPage.Behaviors>
<VerticalStackLayout Margin="20,0,0,0"> <VerticalStackLayout Margin="20,0,0,0">
<Label Text="Werden nur lokal gespeichert"/> <Label Text="Werden nur lokal gespeichert"/>

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels" xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls" xmlns:zxing="clr-namespace:ZXing.Net.Maui.Controls;assembly=ZXing.Net.MAUI.Controls"
xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter" xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter"
@@ -18,35 +19,41 @@
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
StatusBarStyle="LightContent" />
</ContentPage.Behaviors>
<ScrollView> <ScrollView>
<VerticalStackLayout Spacing="10" Margin="15,0"> <VerticalStackLayout Spacing="10" Margin="15,0">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<HorizontalStackLayout Spacing="10" HorizontalOptions="Start" Grid.Column="0"> <HorizontalStackLayout Spacing="5" HorizontalOptions="Start" Grid.Column="0">
<Label FontSize="22" FontAttributes="Bold" Text="{Binding AppTitle}" Margin="0,4,0,0" /> <Label FontSize="20" FontAttributes="Bold" Text="{Binding AppTitle}" Margin="0,7,0,0" />
<Label FontSize="22" Text="{Binding Version}" Margin="0,4,0,0" /> <Label FontSize="16" Text="{Binding Version}" Margin="0,11,0,0" />
</HorizontalStackLayout>
<HorizontalStackLayout HorizontalOptions="End" Spacing="10" Grid.Column="1">
<Label Text="Login QR/manuell" Margin="0,12,0,0"/>
<Switch x:Name="LoginSwitch" IsToggled="False" Toggled="Switch_Toggled"/>
</HorizontalStackLayout> </HorizontalStackLayout>
<Grid Grid.Column="1" ColumnDefinitions="*,50" ColumnSpacing="10">
<Label Text="Login QR/manuell" VerticalOptions="Center" Grid.Column="0"/>
<Switch x:Name="LoginSwitch" IsToggled="False" Toggled="Switch_Toggled" VerticalOptions="Center" Grid.Column="1"/>
</Grid>
</Grid> </Grid>
<Label x:Name="ServerLabel" Text="{Binding Server}" IsVisible="{Binding Server, Converter={StaticResource StringVisibilityConverter}}" /> <Label x:Name="ServerLabel" Text="{Binding Server}" IsVisible="{Binding Server, Converter={StaticResource StringVisibilityConverter}}" />
<VerticalStackLayout x:Name="LoginQR"> <VerticalStackLayout x:Name="LoginQR" Margin="0,20,0,0">
<Label Text="Login mit QR-Code" FontSize="32" HorizontalOptions="Start" /> <Label Text="Login mit QR-Code" FontSize="32" HorizontalOptions="Start" />
<Label x:Name="Message" Text="{Binding Message}" Margin="0,15" /> <Label x:Name="Message" Text="{Binding Message}" Margin="0,15" />
<Border HeightRequest="300" Padding="0"> <Border HeightRequest="300" Padding="0">
<zxing:CameraBarcodeReaderView x:Name="barcodeScannerView" <zxing:CameraBarcodeReaderView
BarcodesDetected="BarcodesDetected" x:Name="barcodeScannerView"
HorizontalOptions="FillAndExpand" BarcodesDetected="BarcodesDetected"
VerticalOptions="FillAndExpand"/> HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>
</Border> </Border>
</VerticalStackLayout> </VerticalStackLayout>

View File

@@ -1,12 +1,21 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:viewModels="clr-namespace:Jugenddienst_Stunden.ViewModels" xmlns:viewModels="clr-namespace:Jugenddienst_Stunden.ViewModels"
x:Class="Jugenddienst_Stunden.Views.NotePage" x:Class="Jugenddienst_Stunden.Views.NotePage"
Title="Notiz"> Title="Notiz">
<ContentPage.BindingContext> <ContentPage.BindingContext>
<viewModels:NoteViewModel /> <viewModels:NoteViewModel />
</ContentPage.BindingContext> </ContentPage.BindingContext>
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
StatusBarStyle="LightContent" />
</ContentPage.Behaviors>
<VerticalStackLayout Spacing="10" Margin="5"> <VerticalStackLayout Spacing="10" Margin="5">
<Editor x:Name="TextEditor" <Editor x:Name="TextEditor"
Placeholder="Gib deine Notiz ein" Placeholder="Gib deine Notiz ein"

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels" xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter" xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter"
x:Class="Jugenddienst_Stunden.Views.StundePage" x:Class="Jugenddienst_Stunden.Views.StundePage"
@@ -17,6 +18,12 @@
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
StatusBarStyle="LightContent" />
</ContentPage.Behaviors>
<VerticalStackLayout Spacing="10" Margin="10"> <VerticalStackLayout Spacing="10" Margin="10">
<Label Text="{Binding SubTitle}" FontSize="Medium" FontAttributes="Bold" Margin="4,0,0,0" /> <Label Text="{Binding SubTitle}" FontSize="Medium" FontAttributes="Bold" Margin="4,0,0,0" />

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:mmodels="clr-namespace:Jugenddienst_Stunden.Models" xmlns:mmodels="clr-namespace:Jugenddienst_Stunden.Models"
xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels" xmlns:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter" xmlns:conv="clr-namespace:Jugenddienst_Stunden.Converter"
@@ -21,11 +22,15 @@
</ResourceDictionary> </ResourceDictionary>
</ContentPage.Resources> </ContentPage.Resources>
<ContentPage.Behaviors>
<toolkit:StatusBarBehavior
StatusBarColor="{AppThemeBinding Dark={StaticResource OffBlack}, Light={StaticResource Primary}}"
StatusBarStyle="LightContent" />
</ContentPage.Behaviors>
<ContentPage.ToolbarItems> <ContentPage.ToolbarItems>
<!--<ToolbarItem Text="Lade Liste" Command="{Binding RefreshListCommand}"/>--> <!--<ToolbarItem Text="Lade Liste" Command="{Binding RefreshListCommand}"/>-->
<ToolbarItem Text="Neuer Eintrag" IconImageSource="{StaticResource ToolbarIcon}" Command="{Binding NewEntryCommand}" /> <ToolbarItem Text="Neuer Eintrag" IconImageSource="{StaticResource ToolbarIcon}" Command="{Binding NewEntryCommand}" />
</ContentPage.ToolbarItems> </ContentPage.ToolbarItems>
<RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}" Margin="10" Padding="10"> <RefreshView x:Name="MyRefreshView" Command="{Binding RefreshCommand}" IsRefreshing="{Binding IsRefreshing}" Margin="10" Padding="10">