Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for temporary notifications (like Android Toast) #2365

Open
Maverobot opened this issue Aug 12, 2021 · 8 comments
Open

Add support for temporary notifications (like Android Toast) #2365

Maverobot opened this issue Aug 12, 2021 · 8 comments
Labels
enhancement New feature or request information-needed Further information is requested

Comments

@Maverobot
Copy link

Maverobot commented Aug 12, 2021

Is your feature request related to a problem? Please describe:

Toast is a standard way in Android to give feedback to the users.

Is it possible to construct a solution with the existing API?

I am not entirely sure because I just started to use this library and am generally also newbie in the Android Development. But after a long time search, I did not find any existing API which provides "toast".

Describe the solution you'd like to see:

An API which does the same as: https://developer.android.com/guide/topics/ui/notifiers/toasts.html

@andydotxyz
Copy link
Member

Because we are focused on cross-platform UI, we can't really add platform-specific features.
That said if there is a general use-case that toast provides we could consider adding a cross-platform solution.

@andydotxyz andydotxyz added the question A question has been asked label Aug 12, 2021
@Maverobot
Copy link
Author

I see your point. It makes sense to avoid platform-specific features.

For Windows

When I search for "toast" in the repo, I found

Windows.UI.Notifications.ToastNotificationManager

here. It seems to me that at least in Windows there is a kind of "toast notification".

For Linux

The "standard" notification (e.g. app.sendNotification) has very similar characteristics like a mobile "toast" message.

For IOS

I have no experience with IOS. But after a bit of googling, I found out IOS also has "toast message" support.

@andydotxyz
Copy link
Member

Does this mean that App.SendNotification is a good enough replacement? That already works on all platforms.

@Maverobot
Copy link
Author

Maverobot commented Aug 12, 2021

I don't think so. On Android, App.SendNotification sends an notification instead of an "toast message". Probably same on IOS. "Notification" and "Toast message" have different use cases.

@andydotxyz
Copy link
Member

OK, but can you expand on what this use-case is then? I got confused in the last message because you called things a notification.

@Maverobot
Copy link
Author

Maverobot commented Aug 12, 2021

Sorry. I will try to explain it.

I called "toast message" also a "notification" because it seems so in the world of Windows.

Windows.UI.Notifications.ToastNotificationManager


"Toast message" is a kind of notification which disappears automatically after a few seconds, while App.SendNotification sends a notification which stays persistent in the "Notification center" of Android until you manually dismiss it. For me, these two kinds of ways of delivering information are different and can not be replaced by each other. Are you asking what use cases toast messages can have? The most important feature is that it disappears after a timeout which AFAIK cannot be done with any of the existing fyne APIs. Please correct me if I am wrong.

@andydotxyz
Copy link
Member

That makes sense. Perhaps ShowTemporaryNotification or adding Notification.Timeout would be a suitable solution?

@Maverobot
Copy link
Author

Notification.Timeout sounds like a good option.

@andydotxyz andydotxyz changed the title Toast support Add support for temporary notifications (like Android Toast) Aug 13, 2021
@Jacalz Jacalz added enhancement New feature or request information-needed Further information is requested and removed question A question has been asked labels Nov 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request information-needed Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants