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

Feature: Displaying snackbar at the top/bottom of desired component #15

Open
saravanabalagi opened this issue Feb 28, 2017 · 6 comments

Comments

@saravanabalagi
Copy link

saravanabalagi commented Feb 28, 2017

It would be nice to have the snackbar displayed at the top/bottom of required components instead of displaying at the very bottom of the whole app. This is especially useful if the app has tabBar at the bottom or when the snackbar has to show on top (again not at the very top but at the top of the desired component)


Edit from maintainer:

A simple, generic way to accomplish this might be to use a top and bottom value similar to how CSS works. With top: 0, the Snackbar would be at the very top of the screen. With bottom: 50, the Snackbar would be 50 dp above the bottom of the screen.

This was originally attempted in #137 but the PR was abandoned before it could be merged. Feel free to take that work as an example.

@cooperka
Copy link
Owner

This feature sounds similar in nature to #11; easy to do with plain JS, but hard to do natively. I would love to re-write this library to be completely JS and not require any linking, but I just haven't had the time quite yet. I'm very open to PRs though :)

Repository owner deleted a comment from prince8verma Oct 11, 2017
Repository owner deleted a comment from jerameel Mar 21, 2018
@Noitidart
Copy link

Nooo complete js please! hahah

The native part is the most awesome part! I think it can easily be supported natively with CoordinatedLayout as this guy demonstrates - https://android.jlelse.eu/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e#2514

@Noitidart
Copy link

The native snackbar also respects the native FAB - https://guides.codepath.com/android/Handling-Scrolls-with-CoordinatorLayout#responding-to-scroll-events - pretty please no pure js haha

@cooperka
Copy link
Owner

Both could be supported at once -- it's not either/or 🙂 There are advantages to each.

@cooperka
Copy link
Owner

I edited the issue description to suggest a generic solution. This is a quite popular request! I would happily merge a PR that does this well.

@cooperka
Copy link
Owner

cooperka commented May 9, 2023

note: #186 was just released as v2.6.0.

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