Kis kerek gombok + Egyéb nyalánkságok
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using Android.Util;
|
||||
using CommunityToolkit.Maui.Alerts;
|
||||
using CommunityToolkit.Maui.Core;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -28,7 +30,7 @@ namespace WorkFlowCheck.MAUI.Helper
|
||||
{
|
||||
using (var httpClient = new HttpClient())
|
||||
{
|
||||
|
||||
|
||||
httpClient.BaseAddress = new Uri(ApiBaseUrl);
|
||||
httpClient.DefaultRequestHeaders.Add("X-Api-Key", ApiKey);
|
||||
|
||||
@@ -51,5 +53,35 @@ namespace WorkFlowCheck.MAUI.Helper
|
||||
}
|
||||
}
|
||||
}
|
||||
public async static Task ShowSnackBar(string message,
|
||||
string actionButtonTextColor = "#FF0000",
|
||||
string backgroundColor = "#FF0000",
|
||||
string textColor = "#FF0000",
|
||||
int duration = 10,
|
||||
string actionButtonText = "Ok",
|
||||
Func<Task> action = null)
|
||||
{
|
||||
var visualOptions = new SnackbarOptions
|
||||
{
|
||||
ActionButtonTextColor = Colors.Yellow,
|
||||
CornerRadius = new CornerRadius(10),
|
||||
Font = Microsoft.Maui.Font.SystemFontOfSize(16),
|
||||
BackgroundColor = Colors.Red,
|
||||
TextColor = Colors.Yellow
|
||||
|
||||
};
|
||||
var snackbar = Snackbar.Make(
|
||||
message,
|
||||
duration: TimeSpan.FromSeconds(duration),
|
||||
action: async () =>
|
||||
{
|
||||
if (action != null)
|
||||
await action();
|
||||
},
|
||||
actionButtonText: actionButtonText,
|
||||
visualOptions: visualOptions
|
||||
);
|
||||
await snackbar.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user