Expand double tap touch area.
This commit is contained in:
parent
5d15eef61d
commit
8c81e47737
2 changed files with 16 additions and 14 deletions
|
@ -385,19 +385,6 @@ class ConversationAdapterV2(
|
||||||
}
|
}
|
||||||
|
|
||||||
private inner class OutgoingMediaViewHolder(itemView: View) : ConversationViewHolder<OutgoingMedia>(itemView) {
|
private inner class OutgoingMediaViewHolder(itemView: View) : ConversationViewHolder<OutgoingMedia>(itemView) {
|
||||||
val gestureDetector = GestureDetector(
|
|
||||||
context,
|
|
||||||
object : SimpleOnGestureListener() {
|
|
||||||
override fun onDoubleTap(e: MotionEvent): Boolean {
|
|
||||||
if (clickListener != null) {
|
|
||||||
clickListener.onItemDoubleClick(getMultiselectPartForLatestTouch())
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
override fun bind(model: OutgoingMedia) {
|
override fun bind(model: OutgoingMedia) {
|
||||||
bindable.setEventListener(clickListener)
|
bindable.setEventListener(clickListener)
|
||||||
bindable.setGestureDetector(gestureDetector)
|
bindable.setGestureDetector(gestureDetector)
|
||||||
|
@ -486,6 +473,19 @@ class ConversationAdapterV2(
|
||||||
val bindable: BindableConversationItem
|
val bindable: BindableConversationItem
|
||||||
get() = itemView as BindableConversationItem
|
get() = itemView as BindableConversationItem
|
||||||
|
|
||||||
|
val gestureDetector: GestureDetector = GestureDetector(
|
||||||
|
context,
|
||||||
|
object : SimpleOnGestureListener() {
|
||||||
|
override fun onDoubleTap(e: MotionEvent): Boolean {
|
||||||
|
if (clickListener != null && selectedItems.isEmpty()) {
|
||||||
|
clickListener.onItemDoubleClick(getMultiselectPartForLatestTouch())
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
override val root: ViewGroup = bindable.root
|
override val root: ViewGroup = bindable.root
|
||||||
|
|
||||||
protected val previousMessage: Optional<MessageRecord>
|
protected val previousMessage: Optional<MessageRecord>
|
||||||
|
@ -512,6 +512,8 @@ class ConversationAdapterV2(
|
||||||
)
|
)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
itemView.setOnTouchListener { _, event: MotionEvent -> gestureDetector.onTouchEvent(event) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bindPayloadsIfAvailable(): Boolean {
|
fun bindPayloadsIfAvailable(): Boolean {
|
||||||
|
|
|
@ -154,7 +154,7 @@ open class V2ConversationItemTextOnlyViewHolder<Model : MappingModel<Model>>(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.body.setOnTouchListener { _, event -> gestureDetector.onTouchEvent(event) }
|
binding.root.setOnTouchListener { _, event -> gestureDetector.onTouchEvent(event) }
|
||||||
binding.root.setOnClickListener { onBubbleClicked() }
|
binding.root.setOnClickListener { onBubbleClicked() }
|
||||||
binding.root.setOnLongClickListener {
|
binding.root.setOnLongClickListener {
|
||||||
conversationContext.clickListener.onItemLongClick(binding.root, getMultiselectPartForLatestTouch())
|
conversationContext.clickListener.onItemLongClick(binding.root, getMultiselectPartForLatestTouch())
|
||||||
|
|
Loading…
Add table
Reference in a new issue