Skip to content

Commit db2497e

Browse files
pallav12atm1504
authored andcommitted
Fixed Link Issue (#2443)
1 parent 7179d96 commit db2497e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

app/src/main/java/org/fossasia/susi/ai/chat/adapters/recycleradapters/ChatFeedRecyclerAdapter.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import android.content.Context
55
import android.content.Intent
66
import android.graphics.drawable.Drawable
77
import android.support.v7.widget.RecyclerView
8+
import android.text.method.LinkMovementMethod
89
import android.util.Pair
910
import android.util.Patterns
1011
import android.view.Gravity
@@ -245,6 +246,7 @@ class ChatFeedRecyclerAdapter(
245246
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
246247
if (holder is ChatViewHolder) {
247248
holder.setView(data?.get(position), getItemViewType(position), currContext)
249+
holder.chatTextView.movementMethod = LinkMovementMethod()
248250
} else if (holder is MapViewHolder) {
249251
holder.setView(data?.get(position), currContext)
250252
} else if (holder is YoutubeVideoViewHolder) {

app/src/main/java/org/fossasia/susi/ai/chat/adapters/viewholders/ChatViewHolder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import timber.log.Timber
2424
class ChatViewHolder(view: View, clickListener: MessageViewHolder.ClickListener, myMessage: Int) :
2525
MessageViewHolder(view, clickListener) {
2626

27-
private val chatTextView: TextView by bindView(R.id.text)
27+
val chatTextView: TextView by bindView(R.id.text)
2828
private val receivedTick: ImageView? by bindOptionalView(R.id.received_tick)
2929
val timeStamp: TextView by bindView(R.id.timestamp)
3030
val backgroundLayout: LinearLayout by bindView(R.id.background_layout)

app/src/main/res/layout/item_susi_message.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
android:text="@string/hello_world"
2929
android:textColor="@color/message_text_color"
3030
android:textColorLink="@color/link_text"
31-
android:textSize="@dimen/text_size_medium" />
31+
android:textSize="@dimen/text_size_medium"
32+
android:autoLink="web"
33+
android:linksClickable="true"/>
3234

3335
<LinearLayout
3436
android:layout_width="wrap_content"

0 commit comments

Comments
 (0)