Closed uzaysan closed 3 years ago
I want to fix this also.
It should be
public void setMentionPattern(@Nullable Pattern pattern) { if (mentionPattern != pattern) { mentionPattern = pattern; recolorize(); } }
here is the problem
in SocialViewHelper
@Override public void setMentionPattern(@Nullable Pattern pattern) { if (mentionPattern != null) { mentionPattern = pattern; recolorize(); } }
mentionPattern is always null and can't be changed
setMentionPattern()
will call this but do nothing
Thank you very much for pointing out this bug. It has been fixed in latest Sonatype SNAPSHOT version.
I'm also having this problem and can't see the fix. How can I use the "latest SNAPSHOT version"? I have this in my build.gradle files:
allprojects {
repositories {
mavenCentral()
google()
jcenter()
maven { url "https://jitpack.io" }
and
implementation "com.hendraanggrian.appcompat:socialview:0.3-rc1"
I'm sorry, since jcenter
shutted down, I can't find a time to reupload to maven central. But it is already in snapshot repositories, so what you need to do is add maven url https://s01.oss.sonatype.org/content/repositories/snapshots
to that DSL.
Then see which versions are available in snapshot builds.
I need a costum regex for usernames so I wanted to change username patter by using setMentionPattern method provided in version 0.3-rc.
But that doesnt make any difference. Autocomplete edittext doesnt use my pattern. It still uses old pattern.
This is how I set pattern
commenttext.setMentionPattern(Pattern.compile("(^|[^\\w])@([\\w\\_\\.]+)"));