Started working on main page
This commit is contained in:
14
src/WorkTime.Mobile/App.xaml
Normal file
14
src/WorkTime.Mobile/App.xaml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version = "1.0" encoding = "UTF-8" ?>
|
||||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:WorkTime.Mobile"
|
||||
x:Class="WorkTime.Mobile.App">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
|
||||
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
17
src/WorkTime.Mobile/App.xaml.cs
Normal file
17
src/WorkTime.Mobile/App.xaml.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using MauiIcons.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using WorkTime.Database;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
public partial class App : Application {
|
||||
public App(DatabaseContext context) {
|
||||
InitializeComponent();
|
||||
_ = new MauiIcon();
|
||||
context.Database.Migrate();
|
||||
}
|
||||
|
||||
protected override Window CreateWindow(IActivationState? activationState) {
|
||||
return new Window(new AppShell());
|
||||
}
|
||||
}
|
||||
37
src/WorkTime.Mobile/AppShell.xaml
Normal file
37
src/WorkTime.Mobile/AppShell.xaml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Shell
|
||||
x:Class="WorkTime.Mobile.AppShell"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:pages="clr-namespace:WorkTime.Mobile.Pages"
|
||||
xmlns:icons="http://www.aathifmahir.com/dotnet/2022/maui/icons"
|
||||
Title="Zeiterfassung">
|
||||
|
||||
<Shell.Resources>
|
||||
<ResourceDictionary>
|
||||
<FontImageSource x:Key="CaptureIcon" Glyph="{icons:Material Schedule}" />
|
||||
<FontImageSource x:Key="AnalysisIcon" Glyph="{icons:Material Schedule}" />
|
||||
<FontImageSource x:Key="SettingsIcon" Glyph="{icons:Material Settings}" />
|
||||
</ResourceDictionary>
|
||||
</Shell.Resources>
|
||||
|
||||
<TabBar>
|
||||
|
||||
<ShellContent
|
||||
Title="Erfassen"
|
||||
Icon="{StaticResource CaptureIcon}"
|
||||
ContentTemplate="{DataTemplate pages:CapturePage}" />
|
||||
|
||||
<ShellContent
|
||||
Title="Auswertung"
|
||||
Icon="{StaticResource AnalysisIcon}"
|
||||
ContentTemplate="{DataTemplate pages:AnalysisPage}" />
|
||||
|
||||
<ShellContent
|
||||
Title="Einstellungen"
|
||||
Icon="{StaticResource SettingsIcon}"
|
||||
ContentTemplate="{DataTemplate pages:SettingsPage}" />
|
||||
|
||||
</TabBar>
|
||||
|
||||
</Shell>
|
||||
7
src/WorkTime.Mobile/AppShell.xaml.cs
Normal file
7
src/WorkTime.Mobile/AppShell.xaml.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
public partial class AppShell : Shell {
|
||||
public AppShell() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
36
src/WorkTime.Mobile/MainPage.xaml
Normal file
36
src/WorkTime.Mobile/MainPage.xaml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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"
|
||||
x:Class="WorkTime.Mobile.MainPage">
|
||||
|
||||
<ScrollView>
|
||||
<VerticalStackLayout
|
||||
Padding="30,0"
|
||||
Spacing="25">
|
||||
<Image
|
||||
Source="dotnet_bot.png"
|
||||
HeightRequest="185"
|
||||
Aspect="AspectFit"
|
||||
SemanticProperties.Description="dot net bot in a submarine number ten" />
|
||||
|
||||
<Label
|
||||
Text="Hello, World!"
|
||||
Style="{StaticResource Headline}"
|
||||
SemanticProperties.HeadingLevel="Level1" />
|
||||
|
||||
<Label
|
||||
Text="Welcome to .NET Multi-platform App UI"
|
||||
Style="{StaticResource SubHeadline}"
|
||||
SemanticProperties.HeadingLevel="Level2"
|
||||
SemanticProperties.Description="Welcome to dot net Multi platform App U I" />
|
||||
|
||||
<Button
|
||||
x:Name="CounterBtn"
|
||||
Text="Click me"
|
||||
SemanticProperties.Hint="Counts the number of times you click"
|
||||
Clicked="OnCounterClicked"
|
||||
HorizontalOptions="Fill" />
|
||||
</VerticalStackLayout>
|
||||
</ScrollView>
|
||||
|
||||
</ContentPage>
|
||||
20
src/WorkTime.Mobile/MainPage.xaml.cs
Normal file
20
src/WorkTime.Mobile/MainPage.xaml.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
public partial class MainPage : ContentPage {
|
||||
int count = 0;
|
||||
|
||||
public MainPage() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnCounterClicked(object? sender, EventArgs e) {
|
||||
count++;
|
||||
|
||||
if (count == 1)
|
||||
CounterBtn.Text = $"Clicked {count} time";
|
||||
else
|
||||
CounterBtn.Text = $"Clicked {count} times";
|
||||
|
||||
SemanticScreenReader.Announce(CounterBtn.Text);
|
||||
}
|
||||
}
|
||||
32
src/WorkTime.Mobile/MauiProgram.cs
Normal file
32
src/WorkTime.Mobile/MauiProgram.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using CommunityToolkit.Maui;
|
||||
using MauiIcons.Material;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using WorkTime.Database;
|
||||
using WorkTime.Mobile.Pages;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
public static class MauiProgram {
|
||||
public static MauiApp CreateMauiApp() {
|
||||
var builder = MauiApp.CreateBuilder();
|
||||
builder
|
||||
.UseMauiApp<App>()
|
||||
.UseMauiCommunityToolkit()
|
||||
.UseMaterialMauiIcons()
|
||||
.ConfigureFonts(fonts => {
|
||||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
|
||||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
|
||||
});
|
||||
|
||||
builder.Services.AddDatabase(FileSystem.AppDataDirectory);
|
||||
|
||||
builder.Services.AddTransient<CapturePageModel>();
|
||||
builder.Services.AddTransient<SettingsPageModel>();
|
||||
|
||||
#if DEBUG
|
||||
builder.Logging.AddDebug();
|
||||
#endif
|
||||
|
||||
return builder.Build();
|
||||
}
|
||||
}
|
||||
9
src/WorkTime.Mobile/Pages/AnalysisPage.xaml
Normal file
9
src/WorkTime.Mobile/Pages/AnalysisPage.xaml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?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"
|
||||
x:Class="WorkTime.Mobile.Pages.AnalysisPage">
|
||||
<ContentPage.Content>
|
||||
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
13
src/WorkTime.Mobile/Pages/AnalysisPage.xaml.cs
Normal file
13
src/WorkTime.Mobile/Pages/AnalysisPage.xaml.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WorkTime.Mobile.Pages;
|
||||
|
||||
public partial class AnalysisPage : ContentPage {
|
||||
public AnalysisPage() {
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
38
src/WorkTime.Mobile/Pages/CapturePage.xaml
Normal file
38
src/WorkTime.Mobile/Pages/CapturePage.xaml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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:components="clr-namespace:WorkTime.Mobile.Pages.Components"
|
||||
xmlns:pages="clr-namespace:WorkTime.Mobile.Pages"
|
||||
xmlns:mi="http://www.aathifmahir.com/dotnet/2022/maui/icons"
|
||||
xmlns:models="clr-namespace:WorkTime.Models;assembly=WorkTime.Models"
|
||||
x:Class="WorkTime.Mobile.Pages.CapturePage"
|
||||
x:DataType="pages:CapturePageModel">
|
||||
|
||||
<ContentPage.Content>
|
||||
<Grid Margin="10" RowSpacing="10" RowDefinitions="Auto,*,Auto">
|
||||
<components:DateSelector Grid.Row="0"
|
||||
Command="{Binding LoadDateCommand}" />
|
||||
|
||||
<ScrollView Grid.Row="1">
|
||||
<CollectionView ItemsSource="{Binding Entries}">
|
||||
<CollectionView.ItemTemplate>
|
||||
<DataTemplate x:DataType="models:TimeEntry">
|
||||
<HorizontalStackLayout Spacing="5">
|
||||
<Label Text="{Binding Timestamp}" />
|
||||
<Label Text="{Binding Type}" />
|
||||
</HorizontalStackLayout>
|
||||
</DataTemplate>
|
||||
</CollectionView.ItemTemplate>
|
||||
</CollectionView>
|
||||
</ScrollView>
|
||||
|
||||
<HorizontalStackLayout Grid.Row="2" HorizontalOptions="Center" Spacing="20">
|
||||
<Button Text="{Binding CurrentTypeName}"
|
||||
Command="{Binding RegisterEntryCommand}" />
|
||||
|
||||
<Button mi:MauiIcon.Value="{mi:Material Icon=Add}" />
|
||||
</HorizontalStackLayout>
|
||||
</Grid>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
106
src/WorkTime.Mobile/Pages/CapturePage.xaml.cs
Normal file
106
src/WorkTime.Mobile/Pages/CapturePage.xaml.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using WorkTime.Models;
|
||||
using WorkTime.Models.Repositories;
|
||||
|
||||
namespace WorkTime.Mobile.Pages;
|
||||
|
||||
public partial class CapturePage : ContentPage {
|
||||
private readonly CapturePageModel _model;
|
||||
|
||||
public CapturePage(CapturePageModel model) {
|
||||
InitializeComponent();
|
||||
BindingContext = model;
|
||||
_model = model;
|
||||
}
|
||||
|
||||
protected override void OnAppearing() {
|
||||
base.OnAppearing();
|
||||
|
||||
if (_model.AppearingCommand.CanExecute(null))
|
||||
_model.AppearingCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class CapturePageModel(ITimeEntryRepository entryRepository) : ObservableObject {
|
||||
|
||||
private DateOnly _currentDate = DateOnly.FromDateTime(DateTime.Now);
|
||||
|
||||
[ObservableProperty]
|
||||
public partial ObservableCollection<TimeEntry> Entries { get; set; } = new();
|
||||
|
||||
[ObservableProperty]
|
||||
public partial EntryType CurrentType { get; set; } = EntryType.Login;
|
||||
|
||||
public string CurrentTypeName => CurrentType switch {
|
||||
EntryType.Login => "Einstempeln",
|
||||
EntryType.LoginHome => "Einstempeln (mobA)",
|
||||
EntryType.LoginTrip => "Dienstreise starten",
|
||||
EntryType.Logout => "Ausstempeln",
|
||||
EntryType.LogoutHome => "Ausstempeln (mobA)",
|
||||
EntryType.LogoutTrip => "Dienstreise beenden",
|
||||
_ => "UNKNOWN"
|
||||
};
|
||||
|
||||
partial void OnCurrentTypeChanged(EntryType value) {
|
||||
OnPropertyChanged(nameof(CurrentTypeName));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task LoadDate(DateOnly date) {
|
||||
_currentDate = date;
|
||||
Entries.Clear();
|
||||
|
||||
var result = await entryRepository.GetTimeEntries(date);
|
||||
foreach (var entry in result) {
|
||||
Entries.Add(entry);
|
||||
}
|
||||
|
||||
UpdateCurrentType();
|
||||
}
|
||||
|
||||
private void UpdateCurrentType() {
|
||||
var last = Entries.LastOrDefault();
|
||||
|
||||
if (last is null) {
|
||||
CurrentType = EntryType.Login;
|
||||
return;
|
||||
}
|
||||
|
||||
CurrentType = last.Type switch {
|
||||
EntryType.Login => EntryType.Logout,
|
||||
EntryType.LoginHome => EntryType.LogoutHome,
|
||||
EntryType.LoginTrip => EntryType.LogoutTrip,
|
||||
|
||||
EntryType.Logout => EntryType.Login,
|
||||
EntryType.LogoutHome => EntryType.LoginHome,
|
||||
EntryType.LogoutTrip => EntryType.LoginTrip,
|
||||
|
||||
_ => EntryType.Login
|
||||
};
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task OnAppearing() {
|
||||
await LoadDate(_currentDate);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task RegisterEntry(TimeEntry? entry = null) {
|
||||
entry ??= new TimeEntry {
|
||||
Timestamp = DateTime.Now,
|
||||
Type = CurrentType
|
||||
};
|
||||
|
||||
await entryRepository.AddTimeEntry(entry);
|
||||
await LoadDate(_currentDate);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task DeleteEntry(Guid entryId) {
|
||||
await entryRepository.DeleteTimeEntry(entryId);
|
||||
await LoadDate(_currentDate);
|
||||
}
|
||||
|
||||
}
|
||||
19
src/WorkTime.Mobile/Pages/Components/DateSelector.xaml
Normal file
19
src/WorkTime.Mobile/Pages/Components/DateSelector.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:components="clr-namespace:WorkTime.Mobile.Pages.Components"
|
||||
x:Class="WorkTime.Mobile.Pages.Components.DateSelector"
|
||||
x:DataType="components:DateSelector"
|
||||
x:Name="Component">
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<Label Grid.Column="0"
|
||||
Text="Tag"
|
||||
VerticalOptions="Center" />
|
||||
|
||||
<DatePicker Grid.Column="1"
|
||||
Date="{Binding CurrentDate, Source={x:Reference Component}}"
|
||||
MaximumDate="{Binding MaxDate, Source={x:Reference Component}}"
|
||||
DateSelected="OnDateSelected"/>
|
||||
</Grid>
|
||||
</ContentView>
|
||||
48
src/WorkTime.Mobile/Pages/Components/DateSelector.xaml.cs
Normal file
48
src/WorkTime.Mobile/Pages/Components/DateSelector.xaml.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace WorkTime.Mobile.Pages.Components;
|
||||
|
||||
public partial class DateSelector : ContentView {
|
||||
|
||||
public static readonly BindableProperty CurrentDateProperty = BindableProperty.Create(
|
||||
nameof(CurrentDate),
|
||||
typeof(DateTime),
|
||||
typeof(DateSelector),
|
||||
DateTime.Now);
|
||||
|
||||
public static readonly BindableProperty MaxDateProperty = BindableProperty.Create(
|
||||
nameof(MaxDate),
|
||||
typeof(DateTime),
|
||||
typeof(DateSelector),
|
||||
DateTime.Now);
|
||||
|
||||
public static readonly BindableProperty CommandProperty = BindableProperty.Create(
|
||||
nameof(Command),
|
||||
typeof(IRelayCommand<DateOnly>),
|
||||
typeof(DateSelector));
|
||||
|
||||
public DateTime CurrentDate {
|
||||
get => (DateTime)GetValue(CurrentDateProperty);
|
||||
set => SetValue(CurrentDateProperty, value);
|
||||
}
|
||||
|
||||
public DateTime MaxDate {
|
||||
get => (DateTime)GetValue(MaxDateProperty);
|
||||
set => SetValue(MaxDateProperty, value);
|
||||
}
|
||||
|
||||
public IRelayCommand<DateOnly>? Command {
|
||||
get => (IRelayCommand<DateOnly>)GetValue(CommandProperty);
|
||||
set => SetValue(CommandProperty, value);
|
||||
}
|
||||
|
||||
public DateSelector() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnDateSelected(object? sender, DateChangedEventArgs e) {
|
||||
var date = DateOnly.FromDateTime(CurrentDate);
|
||||
Command?.Execute(date);
|
||||
}
|
||||
|
||||
}
|
||||
24
src/WorkTime.Mobile/Pages/Components/SettingComponent.xaml
Normal file
24
src/WorkTime.Mobile/Pages/Components/SettingComponent.xaml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<ContentView xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:components="clr-namespace:WorkTime.Mobile.Pages.Components"
|
||||
x:Class="WorkTime.Mobile.Pages.Components.SettingComponent"
|
||||
x:DataType="components:SettingComponent"
|
||||
x:Name="Component">
|
||||
<Grid ColumnDefinitions="*,Auto,80" ColumnSpacing="5">
|
||||
<Label Text="{Binding Title, Source={x:Reference Component}}"
|
||||
VerticalTextAlignment="Center"
|
||||
Grid.Column="0"/>
|
||||
|
||||
<Entry Placeholder="{Binding Placeholder, Source={x:Reference Component}}"
|
||||
Keyboard="Numeric"
|
||||
Grid.Column="1"
|
||||
TextChanged="OnValueChanged"
|
||||
x:Name="EntryField"/>
|
||||
|
||||
<Label Text="{Binding Unit, Source={x:Reference Component}}"
|
||||
VerticalTextAlignment="Center"
|
||||
Grid.Column="2"/>
|
||||
</Grid>
|
||||
</ContentView>
|
||||
@@ -0,0 +1,54 @@
|
||||
namespace WorkTime.Mobile.Pages.Components;
|
||||
|
||||
public partial class SettingComponent : ContentView {
|
||||
public static readonly BindableProperty TitleProperty =
|
||||
BindableProperty.Create(nameof(Title), typeof(string), typeof(SettingComponent), string.Empty);
|
||||
|
||||
public static readonly BindableProperty UnitProperty =
|
||||
BindableProperty.Create(nameof(Unit), typeof(string), typeof(SettingComponent), string.Empty);
|
||||
|
||||
public static readonly BindableProperty PlaceholderProperty =
|
||||
BindableProperty.Create(nameof(Placeholder), typeof(string), typeof(SettingComponent), string.Empty);
|
||||
|
||||
public static readonly BindableProperty ValueProperty =
|
||||
BindableProperty.Create(nameof(Value), typeof(TimeSpan), typeof(SettingComponent), TimeSpan.Zero,
|
||||
BindingMode.TwoWay);
|
||||
|
||||
public string Title {
|
||||
get => (string)GetValue(TitleProperty);
|
||||
set => SetValue(TitleProperty, value);
|
||||
}
|
||||
|
||||
public string Unit {
|
||||
get => (string)GetValue(UnitProperty);
|
||||
set => SetValue(UnitProperty, value);
|
||||
}
|
||||
|
||||
public string Placeholder {
|
||||
get => (string)GetValue(PlaceholderProperty);
|
||||
set => SetValue(PlaceholderProperty, value);
|
||||
}
|
||||
|
||||
public TimeSpan Value {
|
||||
get => (TimeSpan)GetValue(ValueProperty);
|
||||
set => SetValue(ValueProperty, value);
|
||||
}
|
||||
|
||||
public SettingComponent() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnValueChanged(object? sender, TextChangedEventArgs e) {
|
||||
if (!int.TryParse(e.NewTextValue, out var number)) return;
|
||||
|
||||
Value = Unit switch {
|
||||
"Stunden" or "Uhr" => TimeSpan.FromHours(number),
|
||||
"Minuten" => TimeSpan.FromMinutes(number),
|
||||
_ => Value
|
||||
};
|
||||
}
|
||||
|
||||
public void ClearInput() {
|
||||
Content.FindByName<Entry>(nameof(EntryField)).Text = string.Empty;
|
||||
}
|
||||
}
|
||||
97
src/WorkTime.Mobile/Pages/SettingsPage.xaml
Normal file
97
src/WorkTime.Mobile/Pages/SettingsPage.xaml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?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:components="clr-namespace:WorkTime.Mobile.Pages.Components"
|
||||
xmlns:pages="clr-namespace:WorkTime.Mobile.Pages"
|
||||
xmlns:icons="http://www.aathifmahir.com/dotnet/2022/maui/icons"
|
||||
x:Class="WorkTime.Mobile.Pages.SettingsPage"
|
||||
x:DataType="pages:SettingsPageModel">
|
||||
|
||||
<ContentPage.Content>
|
||||
<Grid Margin="20,10" RowDefinitions="*,Auto">
|
||||
<VerticalStackLayout Grid.Row="0" x:Name="SettingsStack">
|
||||
<HorizontalStackLayout Margin="0, 0, 0, 5" Spacing="15">
|
||||
<icons:MauiIcon Icon="{icons:Material Work}"
|
||||
IconSize="30"
|
||||
IconColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
|
||||
<Label Text="Zeiten"
|
||||
FontSize="20"
|
||||
HorizontalTextAlignment="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Arbeitszeit"
|
||||
Unit="Stunden"
|
||||
Placeholder="{Binding Settings.WorkTime.TotalHours}"
|
||||
Value="{Binding Settings.WorkTime, Mode=OneWayToSource}"/>
|
||||
|
||||
|
||||
|
||||
<HorizontalStackLayout Margin="0, 10, 0, 5" Spacing="15">
|
||||
<icons:MauiIcon Icon="{icons:Material LocalPizza}"
|
||||
IconSize="30"
|
||||
IconColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
|
||||
<Label Text="Pause"
|
||||
FontSize="20"
|
||||
HorizontalTextAlignment="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Nach 0 Stunden"
|
||||
Unit="Minuten"
|
||||
Placeholder="{Binding Settings.BreakAfter0.TotalMinutes}"
|
||||
Value="{Binding Settings.BreakAfter0, Mode=OneWayToSource}"/>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Nach 6 Stunden"
|
||||
Unit="Minuten"
|
||||
Placeholder="{Binding Settings.BreakAfter6.TotalMinutes}"
|
||||
Value="{Binding Settings.BreakAfter6, Mode=OneWayToSource}"/>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Nach 9 Stunden"
|
||||
Unit="Minuten"
|
||||
Placeholder="{Binding Settings.BreakAfter9.TotalMinutes}"
|
||||
Value="{Binding Settings.BreakAfter9, Mode=OneWayToSource}"/>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Nicht tracken nach"
|
||||
Unit="Uhr"
|
||||
Placeholder="{Binding Settings.DontTrackBreakAfter.TotalHours}"
|
||||
Value="{Binding Settings.DontTrackBreakAfter, Mode=OneWayToSource}"/>
|
||||
|
||||
|
||||
|
||||
<HorizontalStackLayout Margin="0, 10, 0, 5" Spacing="15">
|
||||
<icons:MauiIcon Icon="{icons:Material CreditCard}"
|
||||
IconSize="30"
|
||||
IconColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
|
||||
<Label Text="Überstunden"
|
||||
FontSize="20"
|
||||
HorizontalTextAlignment="Center"/>
|
||||
</HorizontalStackLayout>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Optimal"
|
||||
Unit="Minuten"
|
||||
Placeholder="{Binding Settings.IdealOvertime.TotalMinutes}"
|
||||
Value="{Binding Settings.IdealOvertime, Mode=OneWayToSource}"/>
|
||||
|
||||
<components:SettingComponent
|
||||
Title="Maximal"
|
||||
Unit="Minuten"
|
||||
Placeholder="{Binding Settings.MaxOvertime.TotalMinutes}"
|
||||
Value="{Binding Settings.MaxOvertime, Mode=OneWayToSource}"/>
|
||||
</VerticalStackLayout>
|
||||
|
||||
<Button Grid.Row="1"
|
||||
Text="Speichern"
|
||||
HorizontalOptions="Center"
|
||||
Command="{Binding SaveSettingsCommand}"/>
|
||||
</Grid>
|
||||
</ContentPage.Content>
|
||||
</ContentPage>
|
||||
49
src/WorkTime.Mobile/Pages/SettingsPage.xaml.cs
Normal file
49
src/WorkTime.Mobile/Pages/SettingsPage.xaml.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using CommunityToolkit.Maui.Alerts;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using WorkTime.Mobile.Pages.Components;
|
||||
using WorkTime.Models;
|
||||
using WorkTime.Models.Repositories;
|
||||
|
||||
namespace WorkTime.Mobile.Pages;
|
||||
|
||||
public partial class SettingsPage : ContentPage {
|
||||
private readonly SettingsPageModel _model;
|
||||
|
||||
public SettingsPage(SettingsPageModel model) {
|
||||
InitializeComponent();
|
||||
BindingContext = model;
|
||||
_model = model;
|
||||
}
|
||||
|
||||
protected override void OnAppearing() {
|
||||
base.OnAppearing();
|
||||
|
||||
if (_model.LoadSettingsCommand.CanExecute(null))
|
||||
_model.LoadSettingsCommand.Execute(null);
|
||||
|
||||
foreach (var child in Content.FindByName<VerticalStackLayout>(nameof(SettingsStack)).Children) {
|
||||
if (child is SettingComponent component)
|
||||
component.ClearInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public partial class SettingsPageModel(ISettingsRepository settingsRepository) : ObservableObject {
|
||||
|
||||
[ObservableProperty]
|
||||
public partial Settings Settings { get; set; }
|
||||
|
||||
[RelayCommand]
|
||||
public async Task LoadSettings() {
|
||||
Settings = await settingsRepository.LoadSettings();
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
public async Task SaveSettings() {
|
||||
await settingsRepository.SaveSettings(Settings);
|
||||
|
||||
await Toast.Make("Einstellungen gespeichert!").Show();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
</manifest>
|
||||
10
src/WorkTime.Mobile/Platforms/Android/MainActivity.cs
Normal file
10
src/WorkTime.Mobile/Platforms/Android/MainActivity.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop,
|
||||
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode |
|
||||
ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density,
|
||||
ScreenOrientation = ScreenOrientation.Portrait)]
|
||||
public class MainActivity : MauiAppCompatActivity;
|
||||
12
src/WorkTime.Mobile/Platforms/Android/MainApplication.cs
Normal file
12
src/WorkTime.Mobile/Platforms/Android/MainApplication.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Android.App;
|
||||
using Android.Runtime;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
[Application]
|
||||
public class MainApplication : MauiApplication {
|
||||
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
|
||||
: base(handle, ownership) { }
|
||||
|
||||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#512BD4</color>
|
||||
<color name="colorPrimaryDark">#2B0B98</color>
|
||||
<color name="colorAccent">#2B0B98</color>
|
||||
</resources>
|
||||
8
src/WorkTime.Mobile/Platforms/MacCatalyst/AppDelegate.cs
Normal file
8
src/WorkTime.Mobile/Platforms/MacCatalyst/AppDelegate.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Foundation;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : MauiUIApplicationDelegate {
|
||||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||
}
|
||||
14
src/WorkTime.Mobile/Platforms/MacCatalyst/Entitlements.plist
Normal file
14
src/WorkTime.Mobile/Platforms/MacCatalyst/Entitlements.plist
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
|
||||
<dict>
|
||||
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. -->
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. -->
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
40
src/WorkTime.Mobile/Platforms/MacCatalyst/Info.plist
Normal file
40
src/WorkTime.Mobile/Platforms/MacCatalyst/Info.plist
Normal file
@@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<!-- The Mac App Store requires you specify if the app uses encryption. -->
|
||||
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
|
||||
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
|
||||
<!-- Please indicate <true/> or <false/> here. -->
|
||||
|
||||
<!-- Specify the category for your app here. -->
|
||||
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
|
||||
<!-- <key>LSApplicationCategoryType</key> -->
|
||||
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.lifestyle</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
||||
13
src/WorkTime.Mobile/Platforms/MacCatalyst/Program.cs
Normal file
13
src/WorkTime.Mobile/Platforms/MacCatalyst/Program.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using ObjCRuntime;
|
||||
using UIKit;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
public class Program {
|
||||
// This is the main entry point of the application.
|
||||
static void Main(string[] args) {
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||
}
|
||||
}
|
||||
8
src/WorkTime.Mobile/Platforms/Windows/App.xaml
Normal file
8
src/WorkTime.Mobile/Platforms/Windows/App.xaml
Normal file
@@ -0,0 +1,8 @@
|
||||
<maui:MauiWinUIApplication
|
||||
x:Class="WorkTime.Mobile.WinUI.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:maui="using:Microsoft.Maui"
|
||||
xmlns:local="using:WorkTime.Mobile.WinUI">
|
||||
|
||||
</maui:MauiWinUIApplication>
|
||||
21
src/WorkTime.Mobile/Platforms/Windows/App.xaml.cs
Normal file
21
src/WorkTime.Mobile/Platforms/Windows/App.xaml.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Microsoft.UI.Xaml;
|
||||
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace WorkTime.Mobile.WinUI;
|
||||
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
/// </summary>
|
||||
public partial class App : MauiWinUIApplication {
|
||||
/// <summary>
|
||||
/// Initializes the singleton application object. This is the first line of authored code
|
||||
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||
/// </summary>
|
||||
public App() {
|
||||
this.InitializeComponent();
|
||||
}
|
||||
|
||||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||
}
|
||||
46
src/WorkTime.Mobile/Platforms/Windows/Package.appxmanifest
Normal file
46
src/WorkTime.Mobile/Platforms/Windows/Package.appxmanifest
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package
|
||||
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||
IgnorableNamespaces="uap rescap">
|
||||
|
||||
<Identity Name="maui-package-name-placeholder" Publisher="CN=User Name" Version="0.0.0.0" />
|
||||
|
||||
<mp:PhoneIdentity PhoneProductId="A39BD2BB-ED8A-4154-B171-D775DC42F056" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||
|
||||
<Properties>
|
||||
<DisplayName>$placeholder$</DisplayName>
|
||||
<PublisherDisplayName>User Name</PublisherDisplayName>
|
||||
<Logo>$placeholder$.png</Logo>
|
||||
</Properties>
|
||||
|
||||
<Dependencies>
|
||||
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
|
||||
</Dependencies>
|
||||
|
||||
<Resources>
|
||||
<Resource Language="x-generate" />
|
||||
</Resources>
|
||||
|
||||
<Applications>
|
||||
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
|
||||
<uap:VisualElements
|
||||
DisplayName="$placeholder$"
|
||||
Description="$placeholder$"
|
||||
Square150x150Logo="$placeholder$.png"
|
||||
Square44x44Logo="$placeholder$.png"
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Square71x71Logo="$placeholder$.png" Wide310x150Logo="$placeholder$.png" Square310x310Logo="$placeholder$.png" />
|
||||
<uap:SplashScreen Image="$placeholder$.png" />
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
<Capabilities>
|
||||
<rescap:Capability Name="runFullTrust" />
|
||||
</Capabilities>
|
||||
|
||||
</Package>
|
||||
17
src/WorkTime.Mobile/Platforms/Windows/app.manifest
Normal file
17
src/WorkTime.Mobile/Platforms/Windows/app.manifest
Normal file
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="WorkTime.Mobile.WinUI.app"/>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<!-- The combination of below two tags have the following effect:
|
||||
1) Per-Monitor for >= Windows 10 Anniversary Update
|
||||
2) System < Windows 10 Anniversary Update
|
||||
-->
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||
|
||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
8
src/WorkTime.Mobile/Platforms/iOS/AppDelegate.cs
Normal file
8
src/WorkTime.Mobile/Platforms/iOS/AppDelegate.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Foundation;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : MauiUIApplicationDelegate {
|
||||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
|
||||
}
|
||||
30
src/WorkTime.Mobile/Platforms/iOS/Info.plist
Normal file
30
src/WorkTime.Mobile/Platforms/iOS/Info.plist
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIDeviceFamily</key>
|
||||
<array>
|
||||
<integer>1</integer>
|
||||
<integer>2</integer>
|
||||
</array>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>arm64</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>XSAppIconAssets</key>
|
||||
<string>Assets.xcassets/appicon.appiconset</string>
|
||||
</dict>
|
||||
</plist>
|
||||
13
src/WorkTime.Mobile/Platforms/iOS/Program.cs
Normal file
13
src/WorkTime.Mobile/Platforms/iOS/Program.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using ObjCRuntime;
|
||||
using UIKit;
|
||||
|
||||
namespace WorkTime.Mobile;
|
||||
|
||||
public class Program {
|
||||
// This is the main entry point of the application.
|
||||
static void Main(string[] args) {
|
||||
// if you want to use a different Application Delegate class from "AppDelegate"
|
||||
// you can specify it here.
|
||||
UIApplication.Main(args, null, typeof(AppDelegate));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This is the minimum required version of the Apple Privacy Manifest for .NET MAUI apps.
|
||||
The contents below are needed because of APIs that are used in the .NET framework and .NET MAUI SDK.
|
||||
|
||||
You are responsible for adding extra entries as needed for your application.
|
||||
|
||||
More information: https://aka.ms/maui-privacy-manifest
|
||||
-->
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPITypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>C617.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>35F9.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>E174.1</string>
|
||||
</array>
|
||||
</dict>
|
||||
<!--
|
||||
The entry below is only needed when you're using the Preferences API in your app.
|
||||
<dict>
|
||||
<key>NSPrivacyAccessedAPIType</key>
|
||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
||||
<array>
|
||||
<string>CA92.1</string>
|
||||
</array>
|
||||
</dict> -->
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
8
src/WorkTime.Mobile/Properties/launchSettings.json
Normal file
8
src/WorkTime.Mobile/Properties/launchSettings.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Windows Machine": {
|
||||
"commandName": "Project",
|
||||
"nativeDebugging": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
src/WorkTime.Mobile/Resources/AppIcon/appicon.png
Normal file
BIN
src/WorkTime.Mobile/Resources/AppIcon/appicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 406 B |
BIN
src/WorkTime.Mobile/Resources/AppIcon/appiconfg.png
Normal file
BIN
src/WorkTime.Mobile/Resources/AppIcon/appiconfg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
src/WorkTime.Mobile/Resources/Fonts/OpenSans-Regular.ttf
Normal file
BIN
src/WorkTime.Mobile/Resources/Fonts/OpenSans-Regular.ttf
Normal file
Binary file not shown.
BIN
src/WorkTime.Mobile/Resources/Fonts/OpenSans-Semibold.ttf
Normal file
BIN
src/WorkTime.Mobile/Resources/Fonts/OpenSans-Semibold.ttf
Normal file
Binary file not shown.
BIN
src/WorkTime.Mobile/Resources/Images/dotnet_bot.png
Normal file
BIN
src/WorkTime.Mobile/Resources/Images/dotnet_bot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 90 KiB |
15
src/WorkTime.Mobile/Resources/Raw/AboutAssets.txt
Normal file
15
src/WorkTime.Mobile/Resources/Raw/AboutAssets.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories). Deployment of the asset to your application
|
||||
is automatically handled by the following `MauiAsset` Build Action within your `.csproj`.
|
||||
|
||||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
|
||||
|
||||
These files will be deployed with your package and will be accessible using Essentials:
|
||||
|
||||
async Task LoadMauiAsset()
|
||||
{
|
||||
using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt");
|
||||
using var reader = new StreamReader(stream);
|
||||
|
||||
var contents = reader.ReadToEnd();
|
||||
}
|
||||
BIN
src/WorkTime.Mobile/Resources/Splash/splash.png
Normal file
BIN
src/WorkTime.Mobile/Resources/Splash/splash.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
44
src/WorkTime.Mobile/Resources/Styles/Colors.xaml
Normal file
44
src/WorkTime.Mobile/Resources/Styles/Colors.xaml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
|
||||
|
||||
<!-- Note: For Android please see also Platforms\Android\Resources\values\colors.xml -->
|
||||
|
||||
<Color x:Key="Primary">#512BD4</Color>
|
||||
<Color x:Key="PrimaryDark">#ac99ea</Color>
|
||||
<Color x:Key="PrimaryDarkText">#242424</Color>
|
||||
<Color x:Key="Secondary">#DFD8F7</Color>
|
||||
<Color x:Key="SecondaryDarkText">#9880e5</Color>
|
||||
<Color x:Key="Tertiary">#2B0B98</Color>
|
||||
|
||||
<Color x:Key="White">White</Color>
|
||||
<Color x:Key="Black">Black</Color>
|
||||
<Color x:Key="Magenta">#D600AA</Color>
|
||||
<Color x:Key="MidnightBlue">#190649</Color>
|
||||
<Color x:Key="OffBlack">#1f1f1f</Color>
|
||||
|
||||
<Color x:Key="Gray100">#E1E1E1</Color>
|
||||
<Color x:Key="Gray200">#C8C8C8</Color>
|
||||
<Color x:Key="Gray300">#ACACAC</Color>
|
||||
<Color x:Key="Gray400">#919191</Color>
|
||||
<Color x:Key="Gray500">#6E6E6E</Color>
|
||||
<Color x:Key="Gray600">#404040</Color>
|
||||
<Color x:Key="Gray900">#212121</Color>
|
||||
<Color x:Key="Gray950">#141414</Color>
|
||||
|
||||
<SolidColorBrush x:Key="PrimaryBrush" Color="{StaticResource Primary}"/>
|
||||
<SolidColorBrush x:Key="SecondaryBrush" Color="{StaticResource Secondary}"/>
|
||||
<SolidColorBrush x:Key="TertiaryBrush" Color="{StaticResource Tertiary}"/>
|
||||
<SolidColorBrush x:Key="WhiteBrush" Color="{StaticResource White}"/>
|
||||
<SolidColorBrush x:Key="BlackBrush" Color="{StaticResource Black}"/>
|
||||
|
||||
<SolidColorBrush x:Key="Gray100Brush" Color="{StaticResource Gray100}"/>
|
||||
<SolidColorBrush x:Key="Gray200Brush" Color="{StaticResource Gray200}"/>
|
||||
<SolidColorBrush x:Key="Gray300Brush" Color="{StaticResource Gray300}"/>
|
||||
<SolidColorBrush x:Key="Gray400Brush" Color="{StaticResource Gray400}"/>
|
||||
<SolidColorBrush x:Key="Gray500Brush" Color="{StaticResource Gray500}"/>
|
||||
<SolidColorBrush x:Key="Gray600Brush" Color="{StaticResource Gray600}"/>
|
||||
<SolidColorBrush x:Key="Gray900Brush" Color="{StaticResource Gray900}"/>
|
||||
<SolidColorBrush x:Key="Gray950Brush" Color="{StaticResource Gray950}"/>
|
||||
</ResourceDictionary>
|
||||
434
src/WorkTime.Mobile/Resources/Styles/Styles.xaml
Normal file
434
src/WorkTime.Mobile/Resources/Styles/Styles.xaml
Normal file
@@ -0,0 +1,434 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
|
||||
|
||||
<Style TargetType="ActivityIndicator">
|
||||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="IndicatorView">
|
||||
<Setter Property="IndicatorColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}"/>
|
||||
<Setter Property="SelectedIndicatorColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray100}}"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Stroke" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
|
||||
<Setter Property="StrokeShape" Value="Rectangle"/>
|
||||
<Setter Property="StrokeThickness" Value="1"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="BoxView">
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource PrimaryDarkText}}" />
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource PrimaryDark}}" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="BorderWidth" Value="0"/>
|
||||
<Setter Property="CornerRadius" Value="8"/>
|
||||
<Setter Property="Padding" Value="14,10"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOver" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="CheckBox">
|
||||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="Color" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="DatePicker">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Editor">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Entry">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray500}}" />
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ImageButton">
|
||||
<Setter Property="Opacity" Value="1" />
|
||||
<Setter Property="BorderColor" Value="Transparent"/>
|
||||
<Setter Property="BorderWidth" Value="0"/>
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="Opacity" Value="0.5" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="PointerOver" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="Headline">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource MidnightBlue}, Dark={StaticResource White}}" />
|
||||
<Setter Property="FontSize" Value="32" />
|
||||
<Setter Property="HorizontalOptions" Value="Center" />
|
||||
<Setter Property="HorizontalTextAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Label" x:Key="SubHeadline">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource MidnightBlue}, Dark={StaticResource White}}" />
|
||||
<Setter Property="FontSize" Value="24" />
|
||||
<Setter Property="HorizontalOptions" Value="Center" />
|
||||
<Setter Property="HorizontalTextAlignment" Value="Center" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Picker">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
|
||||
<Setter Property="TitleColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
<Setter Property="TitleColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ProgressBar">
|
||||
<Setter Property="ProgressColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="ProgressColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="RadioButton">
|
||||
<Setter Property="BackgroundColor" Value="Transparent"/>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="RefreshView">
|
||||
<Setter Property="RefreshColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="SearchBar">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
|
||||
<Setter Property="PlaceholderColor" Value="{StaticResource Gray500}" />
|
||||
<Setter Property="CancelButtonColor" Value="{StaticResource Gray500}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="SearchHandler">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
|
||||
<Setter Property="PlaceholderColor" Value="{StaticResource Gray500}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
<Setter Property="PlaceholderColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Shadow">
|
||||
<Setter Property="Radius" Value="15" />
|
||||
<Setter Property="Opacity" Value="0.5" />
|
||||
<Setter Property="Brush" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource White}}" />
|
||||
<Setter Property="Offset" Value="10,10" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Slider">
|
||||
<Setter Property="MinimumTrackColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="MaximumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray600}}" />
|
||||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="MinimumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/>
|
||||
<Setter Property="MaximumTrackColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/>
|
||||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}"/>
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="SwipeItem">
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Switch">
|
||||
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
<Setter Property="ThumbColor" Value="{StaticResource White}" />
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="On">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="OnColor" Value="{AppThemeBinding Light={StaticResource Secondary}, Dark={StaticResource Gray200}}" />
|
||||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Primary}, Dark={StaticResource White}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="Off">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="ThumbColor" Value="{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TimePicker">
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource White}}" />
|
||||
<Setter Property="BackgroundColor" Value="Transparent"/>
|
||||
<Setter Property="FontFamily" Value="OpenSansRegular"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="MinimumHeightRequest" Value="44"/>
|
||||
<Setter Property="MinimumWidthRequest" Value="44"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="CommonStates">
|
||||
<VisualState x:Name="Normal" />
|
||||
<VisualState x:Name="Disabled">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="TextColor" Value="{AppThemeBinding Light={StaticResource Gray300}, Dark={StaticResource Gray600}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!--
|
||||
<Style TargetType="TitleBar">
|
||||
<Setter Property="MinimumHeightRequest" Value="32"/>
|
||||
<Setter Property="VisualStateManager.VisualStateGroups">
|
||||
<VisualStateGroupList>
|
||||
<VisualStateGroup x:Name="TitleActiveStates">
|
||||
<VisualState x:Name="TitleBarTitleActive">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="Transparent" />
|
||||
<Setter Property="ForegroundColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
<VisualState x:Name="TitleBarTitleInactive">
|
||||
<VisualState.Setters>
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
|
||||
<Setter Property="ForegroundColor" Value="{AppThemeBinding Light={StaticResource Gray400}, Dark={StaticResource Gray500}}" />
|
||||
</VisualState.Setters>
|
||||
</VisualState>
|
||||
</VisualStateGroup>
|
||||
</VisualStateGroupList>
|
||||
</Setter>
|
||||
</Style>
|
||||
-->
|
||||
|
||||
<Style TargetType="Page" ApplyToDerivedTypes="True">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="Shell" ApplyToDerivedTypes="True">
|
||||
<Setter Property="Shell.BackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
|
||||
<Setter Property="Shell.ForegroundColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
|
||||
<Setter Property="Shell.TitleColor" Value="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource SecondaryDarkText}}" />
|
||||
<Setter Property="Shell.DisabledColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
|
||||
<Setter Property="Shell.UnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray200}}" />
|
||||
<Setter Property="Shell.NavBarHasShadow" Value="False" />
|
||||
<Setter Property="Shell.TabBarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Black}}" />
|
||||
<Setter Property="Shell.TabBarForegroundColor" Value="{AppThemeBinding Light={StaticResource Magenta}, Dark={StaticResource White}}" />
|
||||
<Setter Property="Shell.TabBarTitleColor" Value="{AppThemeBinding Light={StaticResource Magenta}, Dark={StaticResource White}}" />
|
||||
<Setter Property="Shell.TabBarUnselectedColor" Value="{AppThemeBinding Light={StaticResource Gray900}, Dark={StaticResource Gray200}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="NavigationPage">
|
||||
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource OffBlack}}" />
|
||||
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}" />
|
||||
<Setter Property="IconColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource White}}" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="TabbedPage">
|
||||
<Setter Property="BarBackgroundColor" Value="{AppThemeBinding Light={StaticResource White}, Dark={StaticResource Gray950}}" />
|
||||
<Setter Property="BarTextColor" Value="{AppThemeBinding Light={StaticResource Magenta}, Dark={StaticResource White}}" />
|
||||
<Setter Property="UnselectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray200}, Dark={StaticResource Gray950}}" />
|
||||
<Setter Property="SelectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
74
src/WorkTime.Mobile/WorkTime.Mobile.csproj
Normal file
74
src/WorkTime.Mobile/WorkTime.Mobile.csproj
Normal file
@@ -0,0 +1,74 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net10.0-android;net10.0-ios;net10.0-maccatalyst</TargetFrameworks>
|
||||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net10.0-windows10.0.19041.0</TargetFrameworks>
|
||||
|
||||
<!-- Note for MacCatalyst:
|
||||
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
|
||||
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
|
||||
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
|
||||
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
|
||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>WorkTime.Mobile</RootNamespace>
|
||||
<UseMaui>true</UseMaui>
|
||||
<SingleProject>true</SingleProject>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<!-- Display name -->
|
||||
<ApplicationTitle>Zeiterfassung</ApplicationTitle>
|
||||
|
||||
<!-- App Identifier -->
|
||||
<ApplicationId>de.leon-hoppe.worktime</ApplicationId>
|
||||
|
||||
<!-- Versions -->
|
||||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
|
||||
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
||||
<WindowsPackageType>None</WindowsPackageType>
|
||||
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">15.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">15.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- App Icon -->
|
||||
<MauiIcon Include="Resources\AppIcon\appicon.png" ForegroundFile="Resources\AppIcon\appiconfg.png" Color="#FFFFFF"/>
|
||||
|
||||
<!-- Splash Screen -->
|
||||
<MauiSplashScreen Include="Resources\Splash\splash.png" Color="#FFFFFF" BaseSize="128,128"/>
|
||||
|
||||
<!-- Images -->
|
||||
<MauiImage Include="Resources\Images\*"/>
|
||||
<MauiImage Update="Resources\Images\dotnet_bot.png" Resize="True" BaseSize="512,512"/>
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<MauiFont Include="Resources\Fonts\*"/>
|
||||
|
||||
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
|
||||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AathifMahir.Maui.MauiIcons.Material" Version="5.0.0" />
|
||||
<PackageReference Include="CommunityToolkit.Maui" Version="12.3.0" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
|
||||
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)"/>
|
||||
<PackageReference Include="Microsoft.Maui.Essentials" Version="$(MauiVersion)"/>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="10.0.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\modules\WorkTime.Database\WorkTime.Database.csproj" />
|
||||
<ProjectReference Include="..\modules\WorkTime.Models\WorkTime.Models.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user