fix: make emote "long-clickable" so our touch handler sees
Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
parent
46a61923a8
commit
f6dfab51af
|
|
@ -1,7 +1,6 @@
|
|||
package chat.revolt.internals.markdown
|
||||
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.text.style.ClickableSpan
|
||||
import android.text.style.ImageSpan
|
||||
import android.view.View
|
||||
import chat.revolt.callbacks.Action
|
||||
|
|
@ -13,10 +12,14 @@ class EmoteSpan(drawable: Drawable) :
|
|||
ImageSpan(drawable, ALIGN_BOTTOM) {
|
||||
}
|
||||
|
||||
class EmoteClickableSpan(private val emoteId: String) : ClickableSpan() {
|
||||
class EmoteClickableSpan(private val emoteId: String) : LongClickableSpan() {
|
||||
override fun onClick(widget: View) {
|
||||
runBlocking(Dispatchers.IO) {
|
||||
ActionChannel.send(Action.EmoteInfo(emoteId))
|
||||
}
|
||||
}
|
||||
|
||||
override fun onLongClick(view: View?) {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue