hanggrian / socialview

Android TextView and EditText with hashtag, mention, and hyperlink support
https://hendraanggrian.github.io/socialview/
Apache License 2.0
322 stars 81 forks source link

setOnHashtagClickListener() Problem & Missing Packages for 0.2 Version #103

Closed haolam98 closed 10 months ago

haolam98 commented 3 years ago

Hello, I tried to get the basic SocialTextView for my hashtags list. For example, SocialTextView will contain: "#abc #efg #123 #fghh #iop". And I want to make it clickable on every hashtag in the SocialTextView.

I followed the readme file but get some trouble with setOnHashtagClickListener().Please help! Thanks

Screen Shot 2021-06-13 at 02 32 11

I think there is only Function2 method suggest for setOnHashtagClickListener(). And I believe this method is for Kotlin, not java. I cannot work with this method since it requires a return of Unit object?

Screen Shot 2021-06-13 at 02 47 16

Also, I cannot update to latest version (0.2) due to some packages does not exist too. I'm currently in version 0.1

Screen Shot 2021-06-13 at 02 49 18
hanggrian commented 3 years ago

I think you're pulling the artifacts from jcenter, which is deprecated by now. Try adding Sonatype's snapshots repository and use version 0.1-SNAPSHOT.

haolam98 commented 3 years ago

Sorry, I'm new to this stuff. How can I add the Sonatype repository to my Android Studio project? I tried to add the Sonatype repo in the Gradel Project, but I think I did it the wrong way. Because, I still get the unresolve NonNull error on the setOnHashtagClickListener() function

Below are my Gradle App and Gradle Project file & the error I got on my Android Studio project:

Screen Shot 2021-07-12 at 11 25 25 Screen Shot 2021-07-12 at 11 26 11 Screen Shot 2021-07-12 at 11 26 45

Thanks

hanggrian commented 2 years ago

In your root build.gradle:

allprojects {
    repositories {
        maven { url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" }
    }
}

Then change the version of the library from 0.2 to 0.1-SNAPSHOT.

mahbub-java commented 2 years ago

why jitpack version not working.... https://jitpack.io/p/hendraanggrian/socialview

https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ could not found

hanggrian commented 10 months ago

Hi all, the library has never been uploaded to Jitpack. It was previously hosted on Jcenter before it was deprecated. Now they are on Maven Central, refer to badges in README for the links.