Remove autoLink attribute which was causing warnings to show twice, and highlight links in comments before a blog is expanded

This commit is contained in:
Katelyn Dickey
2023-01-05 17:20:40 -05:00
parent 5e44e4d308
commit f959c32935
10 changed files with 8 additions and 7 deletions

View File

@@ -171,9 +171,10 @@ class BlogPostViewHolder extends RecyclerView.ViewHolder {
// TODO make author clickable #624
text.setText(c.getComment());
Linkify.addLinks(text, Linkify.WEB_URLS);
text.setMovementMethod(null);
if (fullText) {
text.setTextIsSelectable(true);
Linkify.addLinks(text, Linkify.WEB_URLS);
makeLinksClickable(text, listener::onLinkClick);
}

View File

@@ -1,6 +1,7 @@
package org.briarproject.briar.android.conversation;
import android.content.Context;
import android.text.util.Linkify;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@@ -59,6 +60,7 @@ abstract class ConversationItemViewHolder extends ViewHolder {
if (item.getText() != null) {
text.setText(trim(item.getText()));
Linkify.addLinks(text, Linkify.WEB_URLS);
makeLinksClickable(text, listener::onLinkClick);
}

View File

@@ -1,5 +1,6 @@
package org.briarproject.briar.android.conversation;
import android.text.util.Linkify;
import android.view.View;
import android.widget.TextView;
@@ -41,6 +42,7 @@ class ConversationNoticeViewHolder extends ConversationItemViewHolder {
} else {
msgText.setVisibility(VISIBLE);
msgText.setText(trim(text));
Linkify.addLinks(msgText, Linkify.WEB_URLS);
makeLinksClickable(msgText, listener::onLinkClick);
layout.setBackgroundResource(isIncoming() ?
R.drawable.notice_in_bottom : R.drawable.notice_out_bottom);

View File

@@ -4,6 +4,7 @@ import android.animation.Animator;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
import android.text.util.Linkify;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
@@ -44,6 +45,7 @@ public abstract class BaseThreadItemViewHolder<I extends ThreadItem>
@CallSuper
public void bind(I item, ThreadItemListener<I> listener) {
textView.setText(StringUtils.trim(item.getText()));
Linkify.addLinks(textView, Linkify.WEB_URLS);
makeLinksClickable(textView, listener::onLinkClick);
author.setAuthor(item.getAuthor(), item.getAuthorInfo());