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

Snackbars on iPad span the entire screen width #84

Open
iRoachie opened this issue Aug 11, 2018 · 5 comments
Open

Snackbars on iPad span the entire screen width #84

iRoachie opened this issue Aug 11, 2018 · 5 comments

Comments

@iRoachie
Copy link
Contributor

Hey been using your package for a while.

One concern I have is that Snackbars on iPad are full width compared to on Android where they only take up the required space.

Android:
kapture 2018-08-11 at 12 09 00

iOS:
kapture 2018-08-11 at 12 10 03

@cooperka
Copy link
Owner

Thanks for the report @iRoachie. I'm guessing this would be a simple fix by setting some sort of max width on iOS. Happy to accept PRs!

@iRoachie
Copy link
Contributor Author

I don't mind doing it all, how would we get the width of the content?

@cooperka
Copy link
Owner

I didn't personally write the iOS implementation but I'm guessing one or both of these lines are what determines the width:

You might need to dig into the iOS UI APIs a bit to figure out what needs to be tweaked. This guide recommends 568dp as the max width for Snackbars.

Good luck and thank you for offering!

@TimCatana
Copy link

hello, I see that this thread is old. Skimming through the documentation, I was thinking that it would be better to have an option that allows the developer to adjust the width of the snackbar, rather than having a fixed width. I personally would prefer that the snackbar take up the entire width if the screen no matter the size.

Thinking about it, this shouldn't be difficult to implement. Rather than hard coding a specific width value, you would simply use a custom 'width' option that is added in the .show() method. This will also ensure, I believe, uniformity between both android and IOS versions of the snackbar.

Let me know what you think

@cooperka
Copy link
Owner

thanks @TimCatana, sure I would accept a change like that for iOS!

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

3 participants