fix(Toast) Fixing fading.

This commit is contained in:
2022-04-12 03:03:20 -04:00
parent 1939bbe70a
commit b0032bd865
7 changed files with 72 additions and 61 deletions
+2
View File
@@ -21,6 +21,7 @@ using Services.Immortal;
namespace Services;
public interface IToastService
{
public void Subscribe(Action action);
@@ -29,6 +30,7 @@ public interface IToastService
void RemoveToast(ToastModel toast);
bool HasToasts();
List<ToastModel> GetToasts();
void AgeToasts();
void ClearAllToasts();
}
+10 -1
View File
@@ -41,7 +41,6 @@ public class ToastService : IToastService
public void RemoveToast(ToastModel toast)
{
toasts.Remove(toast);
NotifyDataChanged();
}
public bool HasToasts()
@@ -54,6 +53,16 @@ public class ToastService : IToastService
return toasts;
}
public void AgeToasts()
{
foreach (var toast in toasts)
{
toast.Age++;
}
NotifyDataChanged();
}
public void ClearAllToasts()
{
toasts.Clear();