hanggrian / socialview

Android TextView and EditText with hashtag, mention, and hyperlink support
http://hanggrian.com/socialview/
Apache License 2.0
331 stars 81 forks source link

Class is missed #14

Closed vivchik1337 closed 3 years ago

vivchik1337 commented 7 years ago

Hello, SociableView.class from import com.hendraanggrian.socialview.SociableView is missed. So I can`t do onMentionClickListener, because I need this class.

text.setOnMentionClickListener(new Function2<SociableView, CharSequence, Unit>() {
                    @Override
                    public Unit invoke(SociableView sociableView, CharSequence charSequence) {
                        //my click
                    }
                });
CripyIce commented 7 years ago

Try to replace 'SociableView' class with 'SocialView'

vivchik1337 commented 7 years ago

@CripyIce it`s not working. Nothing happend when I click

hanggrian commented 7 years ago

@CripyIce Yes it should be SocialView. I named it SociableView following Android's own naming convention for Java interfaces that must have their implementation in Java class. But since Kotlin, its interface is much more powerful than Java's (allowing more codebase in interface), that pattern seem to be obsolete so it is now SocialView.

@sfucko About that click listener doing nothing, I need to know several things:

  1. Is your app running on skinned Android like Samsung's TouchWiz? If it is we might have to dig a little deeper because I've only tested it in AVD and my personal device Nexus 6.
  2. Is hashtag click listener also does nothing?
  3. Have you explicitly set MovementMethod to that TextView?

Anyway, Unit is Kotlin's equivalent of Java's Void type, so you should return null on that Function2.

hanggrian commented 3 years ago

Closed due to inactivity.