Support setting / customizing image in Toast or Snackbar #2378
MichaelLHerman
started this conversation in
New Feature Discussions
Replies: 1 comment
-
You can also consider using CommunityToolkit.Maui Popup with an IDispatchTimer. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a design requirement for toast notifications which includes an image and a background color
I'm currently using Mopups library for this, displaying a generated custom view in a Mopups PopupPage, but Mopups does have some random exceptions and I was considering moving to CommunityToolkit.Maui.Alerts
iOS already creates a custom view (PlatformSnackbar/PlatformToast) for toast and would be fairly easy to implement the ability to add an image.
I assume the Snackbar and Toast APIs were created to mirror the Android Material Components apis which don't provide mechanism to add an image. It seems like Android Toast is geared for when the app is in the background since it includes the app icon. This isn't really documented in the Maui Toast API documentation and may be unexpected/undesirable for someone coming from iOS and not Android. (Asked before as #1200) Snackbar does not seem to be a good replacement for Toast because it seems to leave extra space for the action button even when action is null and text is set to String.Empty
Maybe the Android implementation should be a custom view as well (extending BaseTransientBottomBar) to allow full customization - removing the app icon and allowing a custom icon.
Beta Was this translation helpful? Give feedback.
All reactions