nispok / snackbar

[DEPRECATED] Android Library that implements Snackbars from Google's Material Design documentation.
MIT License
1.53k stars 237 forks source link

Activity-independent Snackbar #78

Open deakjahn opened 9 years ago

deakjahn commented 9 years ago

Feature request: snackbars are seemingly intended as replacements for toasts in Android. However, toasts are not dependent on Activities, they only need a Context, meaning that they can be used from services as well, for instance. Any thoughts about reworking Snackbars to match that behavior?

wmora commented 9 years ago

@deakjahn I haven't considered it before. Toasts are messages that are designed to appear to be floating on top of all views thus it makes sense they should be treated as independent messaging widgets. The Snackbar design makes the widget look more attached to a particular view. Don't you think?

deakjahn commented 9 years ago

The new design guidelines seem to prefer snackbars for things that originally called for a toast, I guess. ("Android also provides a capsule-shaped toast, primarily used for system messaging. Toasts are similar to snackbars but do not contain actions and cannot be swiped off screen.") The real problem, as I found in my case, is when you want to show it much like attached but you need to do it from an independent service. The user would see it attached but you have no activity to link it to (unless, of course, you implement the usual workaround to keep track of your current activity from an Application, for instance).