[Spec] Toast control
See original GitHub issueSummary
A toaster view that appears on top of the presented page
API Changes
Add the toast control
e.g.
Some feature would be,
Toaster.Current.FontSize = 13;
Toaster.Current.TextColor = Color.White;
Toaster.Current.BackgroundColor = Color.DodgerBlue;
Toaster.Current.CornerRadius = 8;
Toaster.Current.Padding = new Thickness(20, 10);
Toaster.Current.PositionY = 30;
Toaster.Current.AnimateFor = 500;
Toaster.Current.HideToastIn = 5;
Toaster.Current.LineBreakMode = LineBreakMode.TailTruncation;
Toaster.Current.MaxLines = 1;
ShowToastCommand = new Command(parameter =>
{
Toaster.Current.ToastAction = async () =>
{
await Toaster.Current.HideToaster();
};
Toaster.Current.Text = parameter.ToString();
Toaster.Current.ShowToaster();
});
Intended Use Case
To give users short information about service failures and other similar cases.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Toast Control - Minecraft Mods
This mod allows you to control what toasts show up in Minecraft. By default, Minecraft shows you all toasts, including toasts for Recipes,...
Read more >Toast Control and No Recipe Book for Minecraft 1.12.2
Disable Toasts will full control in Minecraft 1.12.2. Toasts are pop up messages on the screen that show advancements and notifications ...
Read more >Building a toast component - web.dev
A foundational overview of how to build an adaptive and accessible toast component.
Read more >Toasts
A toast appears in reaction to user action: creating, editing, deleting. For example, a user edits an opportunity via a modal and saves...
Read more >Toasts | Design for Driving
A toast is a short, informational message that an app displays briefly near the bottom of the screen. Only one toast can be...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The ideal solution for shadows would be to not use frames. The frame shadow for iOS doesn’t look good at all. Both iOS and Android have platform specific solutions, but they don’t work with Xamarin.Forms frames out of the box.
https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/visualelement-drop-shadow <-- Tried using these with a frame before. The default HasShadow property overrides whatever you set here.
to make it simple, would go with this approach,
DisplayToast(string text, ToastOptions toastOptions = null, ToastLayout toastLayout = null);
which will avoid conflicts for the properties as also discussed in the comments
Closing the toast would simply be,
CloseToast()