socialview
socialview copied to clipboard
Some help to retrieve hashtags and mentions Object and position
Hi,
before saying anything, i'd like to thank you for this library, because it's saving my life!
I'm in need of some support because i have some specifics that your library doesn't fulfill:
- I need to know something more about the mention. I've implemented the Mentionable interface and when i call the mentions method, what the SocialAutoCompleteTextView returns me is a list of String, but i need the source Object and not the String representation... If you can point me in the right direction, i can try to extend SocialAutoCompleteTextView class to have this information...
- Is it possible to get the exact position (start and length) of the spans of every mention? If not, is there a way to extract this information? (maybe from the getSpans(...) method on the editable?)
- I think this is a bug: when i try to get all the hashtags (via the getHashtags method), it goes in IndexOutOfBoundsException, precisely with this stacktrace:
java.lang.IndexOutOfBoundsException: No group 1
at java.util.regex.Matcher.group(Matcher.java:458)
at com.hendraanggrian.appcompat.widget.SocialViewHelper.listOf(SocialViewHelper.java:456)
at com.hendraanggrian.appcompat.widget.SocialViewHelper.getHashtags(SocialViewHelper.java:353)
at com.hendraanggrian.appcompat.widget.SocialAutoCompleteTextView.getHashtags(SocialAutoCompleteTextView.java:347)
I don't know if you need some other information about my env, but if needed, i'll try to explain better
PS: Sorry for the bad english... It's not my first language.
- May I see your source Object that doesn't have a unique string?
- This is possible by providing more arguments to
SocialView.OnClickListener#onClick
, the information is already up there inSocialViewHelper.spanAll
. - I will need your test case to help fix these.
I will be exploring the options in the following days. Thanks for your input and don't worry, English isn't my first language too.
onHashtagtextChangelistener not getting called
@ManpreetKaurTuteja are you using simple EditText or AutoCompleteTextView?
Closed for inactivity.