hanggrian / socialview

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

displayname not show on MentionArrayAdapter #53

Closed jasoncheng closed 5 years ago

jasoncheng commented 5 years ago

as title, please help

doAsync {
            val users = AppDatabase.getInstance().userDao().all()
            val adapter = MentionArrayAdapter<Mention>(context!!)
            uiThread {
                users?.forEach { that ->
                    dLog("User ${that.getEmail()} ${that.name}")
                    adapter.add(Mention(that.getEmail(), "${that.name}", that.profile_image_url_large))
                }
                et_text.mentionAdapter = adapter
            }
}

15574

BTW, thanks for this awesome library 👍

hanggrian commented 5 years ago

Mention.displayname is a nullable property, make sure your user instance and User.text is not null.

jasoncheng commented 5 years ago

even i change it as below, the displayname still not shown Mention(that.getEmail(), "this is test 1234", that.profile_image_url_large)

implementation "com.hendraanggrian.appcompat:socialview:0.1" implementation "com.hendraanggrian.appcompat:socialview-commons:0.1"

hanggrian commented 5 years ago

Sorry for delayed response. I'm aware of this issue and will be fixed in 0.2. Thanks for pointing this out.