Layout fixes and Push fixes
- Layout und Kalender angepasst - Push status meldung angepasst für Android
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using cfs_tracker.Services;
|
||||
@@ -23,25 +24,26 @@ public class MainActivity : MauiAppCompatActivity
|
||||
HandleNotificationIntent(Intent);
|
||||
}
|
||||
|
||||
protected override void OnNewIntent(Android.Content.Intent? intent)
|
||||
protected override void OnNewIntent(Intent? intent)
|
||||
{
|
||||
base.OnNewIntent(intent);
|
||||
if (intent is not null)
|
||||
HandleNotificationIntent(intent);
|
||||
}
|
||||
|
||||
private static void HandleNotificationIntent(Android.Content.Intent? intent)
|
||||
private static void HandleNotificationIntent(Intent? intent)
|
||||
{
|
||||
if (intent is null)
|
||||
return;
|
||||
|
||||
if (!string.Equals(intent.Action, Platforms.Android.AndroidNotificationScheduler.ActionOpenQuickEntry, StringComparison.OrdinalIgnoreCase))
|
||||
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;
|
||||
@@ -51,7 +53,13 @@ public class MainActivity : MauiAppCompatActivity
|
||||
if (navigator is null)
|
||||
return;
|
||||
|
||||
navigator.QueueQuickEntry(date, status, commit);
|
||||
navigator.QueueQuickEntry(date);
|
||||
_ = navigator.FlushAsync();
|
||||
|
||||
intent.SetAction(string.Empty);
|
||||
intent.RemoveExtra(Platforms.Android.AndroidNotificationScheduler.ExtraRoute);
|
||||
intent.RemoveExtra(Platforms.Android.AndroidNotificationScheduler.ExtraDate);
|
||||
intent.RemoveExtra(Platforms.Android.AndroidNotificationScheduler.ExtraStatus);
|
||||
intent.RemoveExtra(Platforms.Android.AndroidNotificationScheduler.ExtraCommit);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user