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

Flush against bottom #66

Closed
Noitidart opened this issue Feb 22, 2018 · 10 comments
Closed

Flush against bottom #66

Noitidart opened this issue Feb 22, 2018 · 10 comments

Comments

@Noitidart
Copy link

The material guidelines is saying that on Android the snackbar should be flush against the bottom of the screen like this:

They shows this video:

https://storage.googleapis.com/material-design/publish/material_v_12/assets/0B6Okdz75tqQsZV9TS3lTVHFzRUE/components-snackbar-usage-fabdo-005.webm

Is it possible to get this flush against bottom with this module?

Also I was looking at the code but not sure, is this a custom implementation of snackbar? Or is it using the actual Android SDK snackbar?

@cooperka
Copy link
Owner

Hi @Noitidart, this library uses the actual Android Snackbar component so it should be up to spec. Do you have a screenshot showing the issue you're experiencing? It seems flush to me, just like in the video.

Note that on Android if you show a Snackbar on top of a modal, the Snackbar may be flush with the bottom of the modal, not necessarily the bottom of the screen. This is a bug documented here.

@Noitidart
Copy link
Author

Noitidart commented Feb 22, 2018

Thanks so so much for such a fast reply!! I actually am getting NullPointer exception when installing:

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.NullPointerException (no error message)

So this was more of a premptive question. I'm sure ill solve this NullPointer in just a bit.

Ah that's awesome it's flush against! When does it decide to be flush against or floating?

The material guidellines here show that we should be doing both depending on the situation:

https://material.io/guidelines/components/snackbars-toasts.html#snackbars-toasts-usage

And thanks once again so much for providing such an awesome module. I'm doing the android version of my app and look for pure native modules and you provided us with this, and with continued support!

@cooperka
Copy link
Owner

I'm glad you like it 😄

This snackbar should never be floating, it will always be flush against the bottom of whatever screen you showed it on. So if your app is full screen, it will be flush against the bottom.

@Noitidart
Copy link
Author

Oh also what led to this question, was in the readme, the snackbar was floating - https://github.com/cooperka/react-native-snackbar#react-native-snackbar

@cooperka
Copy link
Owner

Ah, I see. That image was taken directly from the guide you linked to, it's not floating, just has padding around the image to make it look nicer.

@Noitidart
Copy link
Author

Ohhhh!!! Hahaha! So funny!

Oh I see in that guide they are saying for "2 or more actions", use a "dialog". And "dialog" is not a snackbar ah I see. Thanks very much for such a fast discussion. Do you know if there is a native dialog module which is similar to your methodology of using the actual Android SDK rather then rolling their own (in js or in native)?

@cooperka
Copy link
Owner

Have you tried Alert?

@Noitidart
Copy link
Author

Ah yes I tried that, but these dialogs are like transient (with option for permanent) toasts - but with snackbar-like buttons it seems.

@Noitidart
Copy link
Author

Noitidart commented Feb 22, 2018

Ohhh waiiiit I think I'm totally wrong here. Totally sorry. I have such a better understanding now thanks to you. That's a "Don't Picture"!! Oh my gosh thanks for bearing through with me with your time and leaving this topic open.

@cooperka
Copy link
Owner

Happy to help, let me know if anything else comes up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants