nispok / snackbar

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

Suggestion to expose underlying TextView of the SnackBar for flexibility #115

Closed eclectice closed 9 years ago

eclectice commented 9 years ago

I need something like snackBar.getTextView() so that I can make the underlying textview, snackbarText with spannable text content like hyperlinks to be clickable to open via a web browser...for below example:

final SpannableString msg = new SpannableString(text);
LinkyCustomized.addLinks(msg, LinkifyCustomized.WEB_URLS);
Snakbar bar = Snackbar.with(context).... //whetever
SnackbarManager.show(bar, this);
bar.getTextView().setMovementMethod(LinkMovementMethodWithSelectSupport.getInstance());
eclectice commented 9 years ago

OK, it seems that by simply exposing getTextView() for snackbarText from SnackBar class is ignored by SnackBarManager.show(). I end up creating public SnackBar movementMethod(MovementMethod movementMethod) to allow passing a custom MovementMethod instance to snackbarText