nispok/snackbar

Snackbar appears behind dialogs

Closed this issue · 6 comments

If I show a snackbar in response to a button clicked in a dialog, it shows behind the dialog's dim layer. It should appear on top of everything when summoned IMO

yeah, this is related to #27. It's because of how a dialog attaches to an Activity; I still haven't worked on this

+1 this lib would be perfect if you can fix this issue .....anyway thanks for the awsm lib

Hi. It would be very nice if this issue fixed, but I think it's impossible to solve the issue in straightforward way. Because the Dialogs are placed on different window from Activity's one...

I forked the Snackbar library and solved this issue in a bit different way. I've added the SnackbarManager.show(Snackbar, ViewGroup) method and it makes user can control where to show the Snackbar.

https://github.com/h6ah4i/snackbar/tree/feature/attach_to_non_activity_root_view

show_in_dialog

P.S. @wmora Should I pull request the forked branch to your repository? The use of Snackbar with Dialog is not mentioned in Google's guide line though. (related to #62, #27)

@h6ah4i I think this is the best that can be done for this particular situation. Also, your solution solves #62 too. It would be great if you create a PR for this.

fixed, or at least a workaround is provided, in 2.9.0

This is the solution.
just add your Dialogues view as the second parameter in Snackbar.make(context,view,CharSequence,duration)

Snackbar snackbar = Snackbar
.make(activity,mView, message, Snackbar.LENGTH_INDEFINITE)
.setAction("Ok", new View.OnClickListener() {
@OverRide
public void onClick(View view) {
}
});
snackbar.show();