d11f0e46c0
clean up and fixes - Heute gefixt - Code Cleanup NotificationScheduleItemViewModel -fixed NotificationScheduleItemViewModel for Windows compat push implementation Push fixes Push benachrichtungen eingebaut - Status bei push - Push auch in background - Toggle für symtome angepasst push system change exporter update Optionen fix - Optionen aufgeteilt auf 3 tabs - Anpassungen haben jetzt Farbslider Optimierung fix
57 lines
2.0 KiB
C#
57 lines
2.0 KiB
C#
using Android.App;
|
|
using Android.Content.PM;
|
|
using Android.OS;
|
|
using cfs_tracker.Services;
|
|
|
|
namespace cfs_tracker;
|
|
|
|
[Activity(
|
|
Theme = "@style/Maui.SplashTheme",
|
|
MainLauncher = true,
|
|
LaunchMode = LaunchMode.SingleTop,
|
|
ConfigurationChanges = ConfigChanges.ScreenSize
|
|
| ConfigChanges.Orientation
|
|
| ConfigChanges.UiMode
|
|
| ConfigChanges.ScreenLayout
|
|
| ConfigChanges.SmallestScreenSize
|
|
| ConfigChanges.Density)]
|
|
public class MainActivity : MauiAppCompatActivity
|
|
{
|
|
protected override void OnCreate(Bundle? savedInstanceState)
|
|
{
|
|
base.OnCreate(savedInstanceState);
|
|
HandleNotificationIntent(Intent);
|
|
}
|
|
|
|
protected override void OnNewIntent(Android.Content.Intent? intent)
|
|
{
|
|
base.OnNewIntent(intent);
|
|
if (intent is not null)
|
|
HandleNotificationIntent(intent);
|
|
}
|
|
|
|
private static void HandleNotificationIntent(Android.Content.Intent? intent)
|
|
{
|
|
if (intent is null)
|
|
return;
|
|
|
|
var route = intent.GetStringExtra(Platforms.Android.AndroidNotificationScheduler.ExtraRoute);
|
|
if (!string.Equals(route, "quickentry", StringComparison.OrdinalIgnoreCase))
|
|
return;
|
|
|
|
var dateText = intent.GetStringExtra(Platforms.Android.AndroidNotificationScheduler.ExtraDate);
|
|
var status = intent.GetStringExtra(Platforms.Android.AndroidNotificationScheduler.ExtraStatus);
|
|
var commit = intent.GetBooleanExtra(Platforms.Android.AndroidNotificationScheduler.ExtraCommit, false);
|
|
|
|
if (!DateTime.TryParse(dateText, out var date))
|
|
date = DateTime.Today;
|
|
|
|
var services = IPlatformApplication.Current?.Services;
|
|
var navigator = services?.GetService(typeof(NotificationNavigationService)) as NotificationNavigationService;
|
|
if (navigator is null)
|
|
return;
|
|
|
|
navigator.QueueQuickEntry(date, status, commit);
|
|
_ = navigator.FlushAsync();
|
|
}
|
|
} |