Skip to content
Snippets Groups Projects
Commit f1472a3b authored by Taras's avatar Taras
Browse files

Fix click on text

parent cfe192ef
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,17 @@ abstract class DmTextMessageViewHolder(
abstract val tvMessage: TextView?
protected fun initListeners() {
setListeners()
tvMessage?.apply {
handleLinkClick(this)
setOnLongClickListener {
post?.let { dmOptionsListener.onShowMenuClicked(it.id) }
true
}
}
}
override fun bindHolderSpecific(post: Post) {
bindTextMessage(post)
}
......@@ -48,8 +59,7 @@ class DmMyTextMessageViewHolder(
get() = binding.tvMessage
init {
setListeners()
handleLinkClick(binding.tvMessage)
initListeners()
}
}
......@@ -73,8 +83,7 @@ class DmOtherTextMessageViewHolder(
get() = binding.tvMessage
init {
setListeners()
handleLinkClick(binding.tvMessage)
initListeners()
}
}
\ No newline at end of file
......@@ -43,9 +43,12 @@ abstract class DmViewHolder(
}
}
override fun onSingleTapConfirmed(e: MotionEvent): Boolean {
return true
}
override fun onDoubleTapEvent(e: MotionEvent) = true
override fun onDown(e: MotionEvent) = true
}).apply {
setIsLongpressEnabled(true)
}
......
......@@ -21,8 +21,8 @@ abstract class TimelineListItemViewHolder(view: View) : RecyclerView.ViewHolder(
@SuppressLint("ClickableViewAccessibility")
protected fun handleLinkClick(textView: TextView?) {
textView?.apply {
protected fun handleLinkClick(textView: TextView) {
textView.apply {
movementMethod = InternalLinkMovementMethod(object : OnLinkClickedListener {
override fun onLinkClicked(url: String) {
showLinkConfirmation(context, url)
......
......@@ -77,8 +77,8 @@ abstract class PostViewHolder(
}
postFooter?.setListener(optionsListener)
postHeader.setListener(optionsListener)
readMoreTextView?.let { handleLinkClick(it) }
readMoreTextView?.apply {
handleLinkClick(this)
setNotCollapsableClickAction { openReplies() }
setOnLongClickListener {
postHeader.showMenu()
......
......@@ -14,6 +14,9 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/chip_selected_color"
android:clickable="true"
android:focusable="true"
android:foreground="?selectableItemBackground"
app:layout_constraintBottom_toBottomOf="@id/dmFooter"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/messageBarrier"
......@@ -25,7 +28,6 @@
style="@style/body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:paddingHorizontal="12dp"
android:paddingVertical="8dp"
app:layout_constraintEnd_toEndOf="parent"
......
......@@ -14,6 +14,9 @@
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/post_card_background_color"
android:clickable="true"
android:focusable="true"
android:foreground="?selectableItemBackground"
app:layout_constraintBottom_toBottomOf="@id/dmFooter"
app:layout_constraintEnd_toEndOf="@id/messageBarrier"
app:layout_constraintStart_toStartOf="parent"
......@@ -25,7 +28,6 @@
style="@style/body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:padding="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
......
......@@ -5,7 +5,6 @@
android:id="@+id/lCreatePost"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:animateLayoutChanges="true"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment