Suggestion to expose underlying TextView of the SnackBar for flexibility
Closed this issue · 1 comments
eclectice commented
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
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