diff --git a/README.md b/README.md index 7af2d61..ef74241 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,12 @@ Basic demonstration video: https://youtu.be/daTTTE8QJ0o | Android | yes | | Windows | yes | | IOS | ? (need testing) | -| MacCatalysts | ? (need testing) | +| MacCatalyst | ? (need testing) | I don't have access to Mac build tools, therefore IOS/MacOS is untested, but in theory it should work. If anyone would be willing to test it, I would deeply appreciate it. ## Features ---- + ### Kimai features - Timesheet management (start, stop, delete, recent, all) @@ -46,11 +46,12 @@ I don't have access to Mac build tools, therefore IOS/MacOS is untested, but in - Graphs by [LiveCharts2](https://github.com/beto-rodriguez/LiveCharts2) ## Limitations ---- + - **Kimai v2 is not supported yet** - There are some inconsistencies within in app dark/light theme changing - No support for management of project/customers/teams within app -- Missing support for teams management and team reports +- Missing team reports +- Missing offline time-tracking ## Installation --- diff --git a/src/MauiForKimai.App/App.xaml.cs b/src/MauiForKimai.App/App.xaml.cs index d65d0cb..2a618f6 100644 --- a/src/MauiForKimai.App/App.xaml.cs +++ b/src/MauiForKimai.App/App.xaml.cs @@ -53,7 +53,7 @@ private void OnSettingsPropertyChanged(object sender, PropertyChangedEventArgs e } - private void SetThemeOnStartup() + private void SetThemeOnStartup() { int value = Preferences.Default.Get("mfk_default_theme",-1); if (value != -1) diff --git a/src/MauiForKimai.App/ViewModels/HomeViewModel.cs b/src/MauiForKimai.App/ViewModels/HomeViewModel.cs index 6b15951..5592fab 100644 --- a/src/MauiForKimai.App/ViewModels/HomeViewModel.cs +++ b/src/MauiForKimai.App/ViewModels/HomeViewModel.cs @@ -50,6 +50,10 @@ public HomeViewModel(IRoutingService rs, } + public override async Task OnApplicationResume() + { + await Refresh(); + } private async Task FirstStartUp() { @@ -87,6 +91,8 @@ private void RegisterMessages() [ObservableProperty] string selectedActivity; + [ObservableProperty] + bool isActivityStarting; private async Task StartTimesheet(TimesheetModel model) { @@ -98,6 +104,7 @@ private async Task StartTimesheet(TimesheetModel model) try { + IsActivityStarting = true; var form = model.ToTimesheetEditForm(LoginContext.TimetrackingPermissions, LoginContext.TimeOffset); var timesheet = await timesheetService.Create(form); @@ -114,7 +121,7 @@ private async Task StartTimesheet(TimesheetModel model) } else { - MyTimer.TimerStart(); + //MyTimer.TimerStart(); IsTimetrackingActive = true; var activeTimesheet = (await timesheetService.GetActive()).FirstOrDefault(); if(activeTimesheet == null) @@ -124,8 +131,10 @@ private async Task StartTimesheet(TimesheetModel model) } ActiveTimesheet = activeTimesheet.ToTimesheetActiveModel(); SelectedActivity = ActiveTimesheet.ActivityName; + MyTimer.TimerStartExisting(ActiveTimesheet.Duration); await Toast.Make($"Activity {SelectedActivity} started successfully", ToastDuration.Short, 14).Show(); } + IsActivityStarting = false; } catch (KimaiApiException) @@ -142,6 +151,10 @@ public override async Task Initialize() IsBusy = true; await LoginToDefault(); IsBusy = false; + if(IsTimetrackingActive) + { + await Refresh(); + } } diff --git a/src/MauiForKimai.App/ViewModels/Servers/ServerDetailViewModel.cs b/src/MauiForKimai.App/ViewModels/Servers/ServerDetailViewModel.cs index 8b45092..35178d5 100644 --- a/src/MauiForKimai.App/ViewModels/Servers/ServerDetailViewModel.cs +++ b/src/MauiForKimai.App/ViewModels/Servers/ServerDetailViewModel.cs @@ -334,7 +334,7 @@ async Task Delete() //notify and navigate back IsLoggedToThisServer = false; - + await ReinitializeDatabases(); WeakReferenceMessenger.Default.Send(new ServerRefreshMessage(string.Empty)); await Navigation.NavigateTo(".."); diff --git a/src/MauiForKimai.App/Views/HomeView.xaml b/src/MauiForKimai.App/Views/HomeView.xaml index 4cf94e0..750c731 100644 --- a/src/MauiForKimai.App/Views/HomeView.xaml +++ b/src/MauiForKimai.App/Views/HomeView.xaml @@ -247,8 +247,23 @@ TextColor="Green" VerticalTextAlignment="Center" /> + + + + + +