Play Console and others

This commit is contained in:
2024-09-15 23:51:32 +02:00
parent d54c71a037
commit 17bc9ed190
17 changed files with 325 additions and 98 deletions

View File

@@ -1,5 +1,4 @@
//using AndroidX.Browser.Trusted; 
namespace Jugenddienst_Stunden { namespace Jugenddienst_Stunden {
public partial class App : Application { public partial class App : Application {
public App() { public App() {
@@ -7,11 +6,42 @@ namespace Jugenddienst_Stunden {
MainPage = new AppShell(); MainPage = new AppShell();
//Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi", "OTI6Y1JVUS9RTG1jMTZUbnN2c2JZRm5yRDNiUTZz" }); //Angelika }
//Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi", "Njc6cjltcVJ1SmtITUtFZ3llUVpJcWJzc2NDejVZ" }); //Dario
//Models.Auth.Main(new string[] { "http://hours.dauni.mine.nu:81/appapi?hours", "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=" }); //Christine
} //protected override Window CreateWindow(IActivationState activationState) =>
//new Window(new AppShell()) {
// Width = 500,
// Height = 900
//};
// protected override Window CreateWindow(IActivationState activationState) {
// Window window = base.CreateWindow(activationState);
// window.Activated += Window_Activated;
// return window;
// }
// private async void Window_Activated(object sender, EventArgs e) {
//#if WINDOWS
// const int DefaultWidth = 500;
// const int DefaultHeight = 900;
// var window = sender as Window;
// // change window size.
// window.Width = DefaultWidth;
// window.Height = DefaultHeight;
// // give it some time to complete window resizing task.
// await window.Dispatcher.DispatchAsync(() => { });
// var disp = DeviceDisplay.Current.MainDisplayInfo;
// // move to screen center
// //window.X = (disp.Width / disp.Density - window.Width) / 2;
// //window.Y = (disp.Height / disp.Density - window.Height) / 2;
//#endif
// }
} }
} }

View File

@@ -7,20 +7,20 @@
Shell.FlyoutBehavior="Disabled"> Shell.FlyoutBehavior="Disabled">
<TabBar> <TabBar>
<ShellContent
Title="Stunden"
ContentTemplate="{DataTemplate views:StundenPage}"
Icon="{OnPlatform 'icon_watch.png', iOS='icon_watch_ios.png', MacCatalyst='icon_watch_ios.png'}" />
<ShellContent <ShellContent
Title="Notes" Title="Notes"
ContentTemplate="{DataTemplate views:AllNotesPage}" ContentTemplate="{DataTemplate views:AllNotesPage}"
Icon="{OnPlatform 'icon_notes.png', iOS='icon_notes_ios.png', MacCatalyst='icon_notes_ios.png'}" /> Icon="{OnPlatform 'icon_notes.png', iOS='icon_notes_ios.png', MacCatalyst='icon_notes_ios.png'}" />
<ShellContent
Title="Stunden"
ContentTemplate="{DataTemplate views:StundenPage}"
Icon="{OnPlatform 'icon_watch.png', iOS='icon_about_ios.png', MacCatalyst='icon_watch_ios.png'}" />
<ShellContent <ShellContent
Title="Login" Title="Login"
ContentTemplate="{DataTemplate views:LoginPage}" ContentTemplate="{DataTemplate views:LoginPage}"
Icon="{OnPlatform 'icon_about.png', iOS='icon_about_ios.png', MacCatalyst='icon_about_ios.png'}" /> Icon="{OnPlatform 'icon_security.png', iOS='icon_security_ios.png', MacCatalyst='icon_security_ios.png'}" />
</TabBar> </TabBar>
</Shell> </Shell>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net8.0-ios;net8.0-maccatalyst;net8.0-android34.0</TargetFrameworks> <TargetFrameworks>net8.0-maccatalyst;net8.0-android34.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> --> <!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->
@@ -31,20 +31,32 @@
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">29.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">27.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion> <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<PackageIcon>paket_icon.png</PackageIcon>
<NeutralLanguage>de</NeutralLanguage>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-maccatalyst|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0-maccatalyst|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
<Optimize>True</Optimize>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.26100.0</TargetFrameworks> <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.26100.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android34.0|AnyCPU'">
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<!-- App Icon --> <!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" /> <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
@@ -63,6 +75,13 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="..\paket_icon.png">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.80"> <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.80">
@@ -79,6 +98,9 @@
<Compile Update="Views\LoginPage.xaml.cs"> <Compile Update="Views\LoginPage.xaml.cs">
<DependentUpon>LoginPage.xaml</DependentUpon> <DependentUpon>LoginPage.xaml</DependentUpon>
</Compile> </Compile>
<Compile Update="Views\StundePage.xaml.cs">
<DependentUpon>StundePage.xaml</DependentUpon>
</Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@@ -88,6 +110,9 @@
<MauiXaml Update="Views\AllNotesPage.xaml"> <MauiXaml Update="Views\AllNotesPage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>
<MauiXaml Update="Views\StundePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Views\NotePage.xaml"> <MauiXaml Update="Views\NotePage.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</MauiXaml> </MauiXaml>

View File

@@ -1,5 +1,6 @@
//using BarcodeScanning; //using BarcodeScanning;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Maui.LifecycleEvents;
using ZXing.Net.Maui.Controls; using ZXing.Net.Maui.Controls;
@@ -15,11 +16,15 @@ namespace Jugenddienst_Stunden {
}) })
.UseBarcodeReader(); .UseBarcodeReader();
#if DEBUG #if DEBUG
builder.Logging.AddDebug(); builder.Logging.AddDebug();
#endif #endif
return builder.Build(); return builder.Build();
} }
} }
} }

View File

@@ -11,6 +11,8 @@ namespace Jugenddienst_Stunden.Models
{ {
internal class Stunde : ObservableObject { internal class Stunde : ObservableObject {
//Default-Werte zum Testen //Default-Werte zum Testen
//Katharina //Katharina
@@ -29,6 +31,7 @@ namespace Jugenddienst_Stunden.Models
//private static readonly string requestUrl = $"{BaseAddress}/appapi?hours"; //private static readonly string requestUrl = $"{BaseAddress}/appapi?hours";
public DateTime Date { get; set; } public DateTime Date { get; set; }
private static Hours Hours { get; set; }
@@ -38,9 +41,11 @@ namespace Jugenddienst_Stunden.Models
//apiKey = "MTAyfEJZZnB1L3VwcnhoVms0dDlLZENPZWtUVy85b3xodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk="; //apiKey = "MTAyfEJZZnB1L3VwcnhoVms0dDlLZENPZWtUVy85b3xodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=";
//name = "Kathi"; //name = "Kathi";
//surname = "Wegi"; //surname = "Wegi";
//apiKey = "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk="; //apiKey = "MTQzfEFlMVRjQXdZMnI4RmpxZ0FSY3A0VEN2bVZYVXxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=";
//name = "Chri"; //name = "Chri";
//surname = "Fe"; //surname = "Fe";
//apiKey = "MTI3fDEyYURVdHVZVWRaZk91eDlNcjZDUFlTdmdkNHxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk="; //apiKey = "MTI3fDEyYURVdHVZVWRaZk91eDlNcjZDUFlTdmdkNHxodHRwOi8vaG91cnMuZGF1bmkubWluZS5udTo4MS9hcHBhcGk=";
//name = "Ju"; //name = "Ju";
//surname = "Ze"; //surname = "Ze";
@@ -49,6 +54,10 @@ namespace Jugenddienst_Stunden.Models
//name = "Le"; //name = "Le";
//surname = "Ma"; //surname = "Ma";
//apiKey = "OXxpM0lQcXcySUp0S3hHbzFSb3VqdStwRXlDQmd8aHR0cHM6Ly9ob3Vycy5waWRhLmluZm8vYXBwYXBp";
//name = "Eli";
//surname = "Gap";
//Preferences.Default.Set("apiKey", apiKey); //Preferences.Default.Set("apiKey", apiKey);
//Preferences.Default.Set("name", name); //Preferences.Default.Set("name", name);
@@ -65,7 +74,7 @@ namespace Jugenddienst_Stunden.Models
var tokendata = new TokenData(apiKey); var tokendata = new TokenData(apiKey);
//string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey); //string data = await Auth.GetApiDataWithAuthAsync(requestUrl, apiKey);
string data = await Auth.GetApiDataWithAuthAsync(tokendata.url + "?hours&month=8", tokendata.apiKey); string data = await Auth.GetApiDataWithAuthAsync(tokendata.url + "?hours&month="+DateTime.Today.Month, tokendata.apiKey);
if (data == null) { if (data == null) {
throw new Exception("Keine Daten erhalten"); throw new Exception("Keine Daten erhalten");
@@ -112,10 +121,31 @@ namespace Jugenddienst_Stunden.Models
} }
Hours = hours;
return hours;
}
public static DayTime LoadEntry(int id) {
DayTime hours = Hours.daytime.Find(x => x.id == id);
return hours; return hours;
} }
public static Stunde Load(string filename) {
filename = System.IO.Path.Combine(FileSystem.AppDataDirectory, filename);
if (!File.Exists(filename))
throw new FileNotFoundException("Unable to find file on local storage.", filename);
return
new() {
//Filename = Path.GetFileName(filename),
//Text = File.ReadAllText(filename),
Date = File.GetLastWriteTime(filename)
};
}
} }
} }

View File

@@ -1,4 +1,6 @@
using Microsoft.UI.Xaml; using Microsoft.Maui.LifecycleEvents;
using Microsoft.UI.Xaml;
// To learn more about WinUI, the WinUI project structure, // To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info. // and more about our project templates, see: http://aka.ms/winui-project-info.
@@ -17,6 +19,9 @@ namespace Jugenddienst_Stunden.WinUI {
} }
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -0,0 +1,19 @@
namespace Jugenddienst_Stunden.Types {
public class DayTime {
public int? id;
public int EmployeeId;
public DateTime day;
public int wday;
public TimeOnly begin { get; set; }
public TimeOnly end { get; set; }
public string description { get; set; }
public string? free;
public bool? approved;
public int? type;
public int? project;
public int? gemeinde;
public TimeOnly night;
public Dictionary<string, TimeOnly> total;
public TimeOnly end_print;
}
}

View File

@@ -21,6 +21,7 @@ namespace Jugenddienst_Stunden.Types
//[JsonConverter(typeof(JsonSingleOrEmptyArrayConverter<Hours>))] //[JsonConverter(typeof(JsonSingleOrEmptyArrayConverter<Hours>))]
//public Dictionary<int,decimal> zeit_total_daily; //public Dictionary<int,decimal> zeit_total_daily;
public List<TimeDay> zeit_total_daily_api; public List<TimeDay> zeit_total_daily_api;
public List<DayTime> daytime;
//public List<string> wochensumme; //public List<string> wochensumme;
public string overtime_month; public string overtime_month;
public string overtime; public string overtime;
@@ -37,5 +38,6 @@ namespace Jugenddienst_Stunden.Types
public DateTime Date; public DateTime Date;
public DateTime MinDate; public DateTime MinDate;
public DateTime MaxDate; public DateTime MaxDate;
} }
} }

View File

@@ -0,0 +1,52 @@
using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Jugenddienst_Stunden.ViewModels {
internal class StundeViewModel : ObservableObject, IQueryAttributable {
public int id { get; set; }
private Types.DayTime _stunde;
public string Description {
get => _stunde.description;
set {
if (_stunde.description != value) {
_stunde.description = value;
OnPropertyChanged();
}
}
}
public int Identifier => (int)_stunde.id;
public ICommand SaveCommand { get; private set; }
public ICommand DeleteCommand { get; private set; }
//private async Task Save() {
// _stunde.Date = DateTime.Now;
// _stunde.Save();
// await Shell.Current.GoToAsync($"..?saved={_stunde.Filename}");
//}
//private async Task Delete() {
// _stunde.Delete();
// await Shell.Current.GoToAsync($"..?deleted={_stunde.Filename}");
//}
async void IQueryAttributable.ApplyQueryAttributes(IDictionary<string, object> query) {
if (query.ContainsKey("load")) {
DateTime heute = DateTime.Now;
//_stunde = await Models.Stunde.LoadDay(heute);
//_stunde = await Models.Stunde.LoadData();
//RefreshProperties();
}
}
}
}

View File

@@ -15,23 +15,18 @@ namespace Jugenddienst_Stunden.ViewModels {
public string Surname => AppInfo.VersionString; public string Surname => AppInfo.VersionString;
public string MoreInfoUrl => "https://aka.ms/maui"; public string MoreInfoUrl => "https://aka.ms/maui";
public string Message => "Hier werden deine geleisteten Arbeitsstunden aufgelistet"; public string Message => "Hier werden deine geleisteten Arbeitsstunden aufgelistet";
public string LoadOverview => "Lade Summen für " + DateTime.Today.ToString("MMMM");
public static DateTime GetDay = DateTime.Today;
public string ShowDay => "Zeit an Tag " + GetDay.ToString("ddd d. MMM") + ": ";
public int id { get; set; }
public ICommand SelectEntryCommand { get; }
public ICommand LoadDataCommand { get; private set; } public ICommand LoadDataCommand { get; private set; }
public object Stunden { get; } public object Stunden { get; }
public static int GetDay = DateTime.Today.Day;
public string ShowDay => "Zeit an Tag " + GetDay + ": ";
/* Nicht gemergte Änderung aus Projekt "Jugenddienst Stunden (net8.0-ios)"
Vor:
private Models.Hours _hour;
public Models.Hours Hours {
get => _hour;
Nach:
private Hours _hour;
public Hours Hours {
get => _hour;
*/
private Types.Hours _hour; private Types.Hours _hour;
public Types.Hours Hours { public Types.Hours Hours {
get => _hour; get => _hour;
@@ -52,6 +47,10 @@ namespace Jugenddienst_Stunden.ViewModels {
get => _hour.overtime_month; get => _hour.overtime_month;
} }
public List<DayTime> DayTimes {
get => _hour.daytime;
}
public DateTime MinimumDate { public DateTime MinimumDate {
//get => _hour.MinDate; //get => _hour.MinDate;
//get => DateTime.Today.AddDays(-21); //get => DateTime.Today.AddDays(-21);
@@ -69,12 +68,13 @@ namespace Jugenddienst_Stunden.ViewModels {
set { set {
if (dateToday != value) { if (dateToday != value) {
dateToday = value; dateToday = value;
GetDay = dateToday.Day; GetDay = value;
OnPropertyChanged(); OnPropertyChanged();
_ = LoadDay(value); // Use discard operator to explicitly ignore the returned Task _ = LoadDay(value); // Use discard operator to explicitly ignore the returned Task
//RefreshProperties(); //RefreshProperties();
OnPropertyChanged(nameof(TimeDay)); OnPropertyChanged(nameof(TimeDay));
OnPropertyChanged(nameof(ShowDay)); OnPropertyChanged(nameof(ShowDay));
OnPropertyChanged(nameof(DayTimes));
} }
} }
} }
@@ -83,9 +83,6 @@ namespace Jugenddienst_Stunden.ViewModels {
get => _hour.Date; get => _hour.Date;
} }
//public Dictionary<int, decimal> ZeitTotalDaily {
// get => _hour.zeit_total_daily;
//}
public List<TimeDay> ZeitTotalDaily { public List<TimeDay> ZeitTotalDaily {
get => _hour.zeit_total_daily_api; get => _hour.zeit_total_daily_api;
@@ -133,20 +130,24 @@ namespace Jugenddienst_Stunden.ViewModels {
_hour = new Types.Hours(); _hour = new Types.Hours();
LoadDataCommand = new AsyncRelayCommand(LoadData); LoadDataCommand = new AsyncRelayCommand(LoadData);
SelectEntryCommand = new AsyncRelayCommand<ViewModels.StundeViewModel>(SelectEntryAsync);
} }
//protected void OnPropertyChanged(string propertyName) { private async Task SelectEntryAsync(ViewModels.StundeViewModel entry) {
// PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); if (entry != null)
//} await Shell.Current.GoToAsync($"{nameof(Views.StundePage)}?load={entry.id}");
}
//public async Task LoadData() =>
// await Models.Stunde.LoadData();
public event EventHandler<string> AlertEvent; public event EventHandler<string> AlertEvent;
public async Task LoadData() { public async Task LoadData() {
try { try {
_hour = await Models.Stunde.LoadData(); _hour = await Models.Stunde.LoadData();
RefreshProperties();
} catch (Exception e) { } catch (Exception e) {
AlertEvent?.Invoke(this, e.Message); AlertEvent?.Invoke(this, e.Message);
} }
@@ -156,8 +157,11 @@ namespace Jugenddienst_Stunden.ViewModels {
try { try {
_hour = await Models.Stunde.LoadDay(date); _hour = await Models.Stunde.LoadDay(date);
if (_hour.zeit_total_daily_api != null) { if (_hour.zeit_total_daily_api != null) {
TimeDay = _hour.zeit_total_daily_api.Where(static p => p.Day == GetDay).ToList() ?? new List<TimeDay> { new TimeDay { Day = GetDay, Hours = 0 } }; TimeDay = _hour.zeit_total_daily_api.Where(static p => p.Day == GetDay.Day).ToList() ?? new List<TimeDay> { new TimeDay { Day = GetDay.Day, Hours = 0 } };
RefreshProperties(); //RefreshProperties();
OnPropertyChanged(nameof(ShowDay));
OnPropertyChanged(nameof(TimeDay));
OnPropertyChanged(nameof(DayTimes));
} }
} catch (Exception e) { } catch (Exception e) {
AlertEvent?.Invoke(this, e.Message); AlertEvent?.Invoke(this, e.Message);

View File

@@ -0,0 +1,18 @@
<?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:models="clr-namespace:Jugenddienst_Stunden.ViewModels"
x:Class="Jugenddienst_Stunden.Views.StundePage"
Title="StundePage">
<ContentPage.BindingContext>
<models:StundeViewModel />
</ContentPage.BindingContext>
<VerticalStackLayout>
<Label
Text="Welcome to .NET MAUI!"
VerticalOptions="Center"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ContentPage>

View File

@@ -0,0 +1,9 @@
namespace Jugenddienst_Stunden.Views;
public partial class StundePage : ContentPage
{
public StundePage()
{
InitializeComponent();
}
}

View File

@@ -9,11 +9,12 @@
<models:StundenViewModel /> <models:StundenViewModel />
</ContentPage.BindingContext> </ContentPage.BindingContext>
<VerticalStackLayout Spacing="10" Margin="15"> <ScrollView Margin="5">
<VerticalStackLayout Spacing="10" Margin="10">
<Label Text="{Binding Message}" /> <Label Text="{Binding Message}" />
<Button Text="Lade aktuelle Daten" Command="{Binding LoadDataCommand}" /> <Button Text="{Binding LoadOverview}" Command="{Binding LoadDataCommand}" />
<Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10"> <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*" Margin="10">
<Label Text="Soll:" Grid.Row="0" Background="DarkSalmon" /> <Label Text="Soll:" Grid.Row="0" Background="DarkSalmon" />
@@ -36,14 +37,14 @@
<Grid RowDefinitions="Auto" ColumnDefinitions="Auto,*"> <Grid RowDefinitions="Auto" ColumnDefinitions="Auto,*">
<DatePicker Grid.Column="0" MinimumDate="{Binding MinimumDate}" <DatePicker Grid.Column="0" MinimumDate="{Binding MinimumDate}"
MaximumDate="{Binding MaximumDate}" MaximumDate="{Binding MaximumDate}"
Date="{Binding DateToday}" Format="dddd, d. MMM. yyyy" /> Date="{Binding DateToday}" Format="dddd, d. MMM yyyy" />
<Border Grid.Column="1" Margin="15,0,0,0" Padding="15,0,0,0"> <Border Grid.Column="1" Margin="15,0,0,0" Padding="15,0,0,0">
<Label Text="{Binding TimeDay[0].Hours}" VerticalOptions="Center"></Label> <Label Text="{Binding TimeDay[0].Hours}" VerticalOptions="Center"></Label>
</Border> </Border>
</Grid> </Grid>
<Grid ColumnDefinitions="*,*,*"> <!--<Grid ColumnDefinitions="*,*,*">
<Picker x:Name="pick_gemeinde" Title="Gemeinde" ItemsSource="{Binding Options}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="0" > <Picker x:Name="pick_gemeinde" Title="Gemeinde" ItemsSource="{Binding Options}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="0" >
</Picker> </Picker>
<Picker x:Name="pick_projekt" Title="Projekt" ItemsSource="{Binding OptionsProjekt}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="1" > <Picker x:Name="pick_projekt" Title="Projekt" ItemsSource="{Binding OptionsProjekt}" SelectedItem="{Binding SelectedOption, Mode=TwoWay}" Grid.Column="1" >
@@ -58,23 +59,46 @@
<Border Background="LightGreen"> <Border Background="LightGreen">
<HorizontalStackLayout> <HorizontalStackLayout>
<Label Text="Beginn" TextColor="Gray" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label> <Label Text="Beginn" TextColor="Gray" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label>
<TimePicker HorizontalOptions="Center" TextColor="Gray" Format="HH:mm" MinimumWidthRequest="80" /> <TimePicker x:Name="TimeBegin" HorizontalOptions="Center" TextColor="Gray" Format="HH:mm" MinimumWidthRequest="80" />
</HorizontalStackLayout> </HorizontalStackLayout>
</Border> </Border>
<Border Background="OrangeRed"> <Border Background="OrangeRed">
<HorizontalStackLayout> <HorizontalStackLayout>
<Label Text="Ende" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label> <Label Text="Ende" TextColor="White" VerticalTextAlignment="Center" HorizontalTextAlignment="End" Padding="0,0,10,0" Margin="5,0,0,13"></Label>
<TimePicker TextColor="White" Format="HH:mm" MinimumWidthRequest="80" /> <TimePicker x:Name="TimeEnd" TextColor="White" Format="HH:mm" MinimumWidthRequest="80" />
</HorizontalStackLayout> </HorizontalStackLayout>
</Border> </Border>
</FlexLayout> </FlexLayout>-->
<!--<ListView ItemsSource="{Binding DayTimes}" VerticalScrollBarVisibility="Never" ItemSelected="{Binding SelectEntryCommand}">-->
<ListView ItemsSource="{Binding DayTimes}" VerticalScrollBarVisibility="Never">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<Grid Padding="15,10,0,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<HorizontalStackLayout Grid.Row="0" Grid.Column="0">
<Label Grid.Row="0" Grid.Column="0" Text="{Binding begin}"/>
<Label Text="bis" Padding="10,0,10,0"/>
<Label Grid.Row="0" Grid.Column="1" Text="{Binding end}"/>
</HorizontalStackLayout>
<Label Text="{Binding ShowDay}"></Label> <Label Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Text="{Binding description}" Padding="0,0,0,5"/>
</Grid>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</VerticalStackLayout> </VerticalStackLayout>
</ScrollView>
</ContentPage> </ContentPage>

View File

@@ -22,4 +22,8 @@ public partial class StundenPage : ContentPage {
protected void OnDateSelected(object sender, DateChangedEventArgs e) { protected void OnDateSelected(object sender, DateChangedEventArgs e) {
DateTime selectedDate = e.NewDate; DateTime selectedDate = e.NewDate;
} }
private void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs e) {
throw new Exception();
}
} }

BIN
paket_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB