Add clickable links to blog comments

This commit is contained in:
Katelyn Dickey
2022-09-04 13:41:51 -04:00
parent 75d5dec45f
commit 5e44e4d308
2 changed files with 7 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package org.briarproject.briar.android.blog;
import android.content.Context;
import android.content.Intent;
import android.text.Spanned;
import android.text.util.Linkify;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -170,7 +171,11 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
// TODO make author clickable #624
text.setText(c.getComment());
if (fullText) text.setTextIsSelectable(true);
if (fullText) {
text.setTextIsSelectable(true);
Linkify.addLinks(text, Linkify.WEB_URLS);
makeLinksClickable(text, listener::onLinkClick);
}
commentContainer.addView(v);
}

View File

@@ -33,6 +33,7 @@
android:paddingBottom="@dimen/listitem_vertical_margin"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/text_size_small"
android:textColorLink="@color/briar_text_link"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/authorView"