NTP-782 | make chat widget content copyable (#11763)
This commit is contained in:
@@ -9,9 +9,11 @@ package com.navi.chat.ui.activities
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.graphics.Rect
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
@@ -182,7 +184,22 @@ class NaviChatActivity :
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(event: MotionEvent?): Boolean {
|
||||
return super.customDispatchTouchEvent(event)
|
||||
event?.let { event ->
|
||||
if (event.action == MotionEvent.ACTION_DOWN) {
|
||||
val view: View? = currentFocus
|
||||
if (view != null) {
|
||||
val outRect = Rect()
|
||||
view.getGlobalVisibleRect(outRect)
|
||||
if (!outRect.contains(event.rawX.toInt(), event.rawY.toInt())) {
|
||||
view.clearFocus()
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.customDispatchTouchEvent(event)
|
||||
}
|
||||
?: kotlin.run {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/tvConversationStatus"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/title"
|
||||
style="@style/NaviChatReceivedMessageStyle"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="match_parent"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
android:fontFamily="@font/tt_regular"
|
||||
android:textColor="@color/title_color_one"
|
||||
android:textSize="@dimen/font_small"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="Welcome" />
|
||||
|
||||
</com.navi.naviwidgets.widgets.NaviChatMessageWithItemWidget>
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
android:background="@null"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
android:paddingBottom="@dimen/dp_0"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="Welcome" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
style="@style/NaviChatReceivedMessageStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:textIsSelectable="true"
|
||||
android:fontFamily="@font/tt_regular"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvTimestamp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tvSentMessage"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/label"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="0dp"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -35,6 +36,7 @@
|
||||
|
||||
<com.navi.design.textview.NaviTextView
|
||||
android:id="@+id/description"
|
||||
android:textIsSelectable="true"
|
||||
android:layout_width="0dp"
|
||||
android:paddingEnd="@dimen/dp_14"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user