Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Toast and SnackBar CornerRadius #1399

Closed
jrahma opened this issue Jun 15, 2021 · 18 comments
Closed

Toast and SnackBar CornerRadius #1399

jrahma opened this issue Jun 15, 2021 · 18 comments
Labels
feature-request A request for a new feature. needs-approval Feature request has been submitted but is awaiting final approval. Please do not implement before!

Comments

@jrahma
Copy link

jrahma commented Jun 15, 2021

Hi,

Please add CornerRadius to the Toast and SnackBar to set the radius for the corners

CornerRadius="0,25,0,25"

Thanks

@jrahma jrahma added feature-request A request for a new feature. needs-approval Feature request has been submitted but is awaiting final approval. Please do not implement before! labels Jun 15, 2021
@Tommigun1980
Copy link

Hi.

The SnackBar looks good on Android (as it's using the native component), but on iOS something like this is sorely missing. The fully square notification on iOS doesn't really look production ready. Considering that a corner radius is probably not applicable on all platforms, how about adding some corner rounding on iOS without necessarily making it user adjustable? The fully square iOS notification clearly is lacking some visual polish so this is just my suggestion for a quite quick fix that would have a large impact.

Thank you.

@jfversluis
Copy link
Member

Yeah this will be an interesting challenge. Like you say, on Android natively it looks better as it is a native control. Not sure if we can actually change these settings there?

So, if we want to implement a property like this, then it will work for all platforms besides Android maybe? Which is not great.

Would it help if we made the look more consistent out of the box? Or you really want to have that control over the corner radius?

@jfversluis
Copy link
Member

Also @jrahma as indicated in the other issue, please fill out the template as much as possible. Not doing so will result in the issue being closed in the future. We have the templates there for a reason, we'd love for you to think with us a little bit on the implementation and how you want to use it.

@VladislavAntonyuk
Copy link
Contributor

For the one hand we can manually implement Android instead of using Google implementation. For the other hand it would be nice if other platforms (at least Apple) implement it.

@maxkoshevoi
Copy link
Contributor

maxkoshevoi commented Jun 20, 2021

@VladislavAntonyuk Native Android SnackBar has margin, corner radius, shadow, both dark and white themes, and "swipe to dismiss". I think it's better to use native one for Android

image

@VladislavAntonyuk
Copy link
Contributor

@maxkoshevoi I don't like that native implementation has only 1 snackbar action button. it is the only 1 reason why I am voting for the custom implementation. as for the CornerRadius, I believe it is pretty simple to add (similar to the Padding property).

@maxkoshevoi
Copy link
Contributor

maxkoshevoi commented Jun 20, 2021

native implementation has only 1 snackbar action button

This is by design: https://material.io/components/snackbars#anatomy

image

image

@VladislavAntonyuk
Copy link
Contributor

But all other platforms display multiple action buttons, so we get inconsistency between different platforms.
some customers prefer native experience, while others choose consistency across all platforms.

@VladislavAntonyuk
Copy link
Contributor

I will try to find a way to inject an action button in the snackbar layout.

@Tommigun1980
Copy link

My two cents is to always go for the native implementation when one exists, as it's probably one of the main reasons to use Xamarin.Forms/MAUI over "framebuffer solutions" like Flutter.

So in this case I think that the Android implementation should definitely be native, but all relevant properties should preferably be exposed. Then "emulate" it on unsupported platforms like iOS. The iOS snack bar message looks quite out of place atm. as it's just a pure rectangle, so exposing the corner radius (etc.) settings on Android and implementing them on iOS is imho the best way to go.

Imho it results in the best experience -- a familiar control on Android where the control is natively supported, and a somewhat customisable emulated version on iOS.

@maxkoshevoi
Copy link
Contributor

all other platforms display multiple action buttons

Could you please give an example (screenshot) of a mobile app with 2+ snackbar actions? I'm interested of how they would fit and be clearly separated. Are other mobile platforms put them on the second row?
(I'm not interested in desktop here since it has much more space to work with)

@VladislavAntonyuk
Copy link
Contributor

VladislavAntonyuk commented Jun 20, 2021

all other platforms display multiple action buttons

Could you please give an example (screenshot) of a mobile app with 2+ snackbar actions? I'm interested of how they would fit and be clearly separated. Are other mobile platforms put them on the second row?

(I'm not interested in desktop here since it has much more space to work with)

https://user-images.githubusercontent.com/33021114/117999189-44058c00-b34d-11eb-91c7-bb3bee0f94c6.png

For iOS we use UIStackView as a container. We can replace it with any other container which will automatically adjust the components positions

@Cfun1
Copy link
Contributor

Cfun1 commented Jun 20, 2021

@VladislavAntonyuk wouldn't be easier that the dev achieve that with the existing Popup control?

@maxkoshevoi
Copy link
Contributor

@VladislavAntonyuk I meant native SnackBar. Your screenshot doesn't look like it adheres to any kind of style guide.
SnackBar is not customizable for a reason. It's just meant to notify user about some progress being done. That's it. It's better to not overcomplicate that UI.

I think if iOS doesn't have native SnackBar, it should exactly copy Android's one (like suggested by @Tommigun1980) as it's already has a great well documented, and thought through design. Let's not reinvent the wheel here.

image
image
image
image

@Tommigun1980
Copy link

Hi.

I think that this is actually a pretty high priority feature request. The iOS SnackBar (and probably Toast, haven't tested) looks really out of place as it's just a large rectangle. If #1425 was implemented (i.e. corner radius etc. were exposed), and the iOS "emulated" rendering updated to support it I think the component would become a lot more usable on iOS. The rectangle on iOS is so placeholder looking right now that it'd be hard to use it in a production app.

Also, another high priority fix for iOS is #1225 -- i.e. ability to dismiss the notifications by swiping them away.

The SnackBar/Toast components are so useful but unfortunately lacking on iOS atm. and I'd be absolutely thrilled if they received a small pass to get the iOS versions up to par.

Thank you!!

@VladislavAntonyuk
Copy link
Contributor

Ok, I will create a PR tomorrow.

@VladislavAntonyuk
Copy link
Contributor

Can we close this issue?

@pictos
Copy link
Contributor

pictos commented Jul 7, 2021

Closing the issue❣

@pictos pictos closed this as completed Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request A request for a new feature. needs-approval Feature request has been submitted but is awaiting final approval. Please do not implement before!
Projects
None yet
Development

No branches or pull requests

7 participants