mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
android:layout_marginBottom="@dimen/message_bubble_padding_bottom_inner"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textColorLink="@color/briar_text_link"
|
||||
android:autoLink="web"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toTopOf="@+id/statusLayout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
android:layout_marginBottom="@dimen/message_bubble_padding_bottom_inner"
|
||||
android:textColor="@color/briar_text_primary_inverse"
|
||||
android:textColorLink="@color/briar_text_link_inverse"
|
||||
android:autoLink="web"
|
||||
app:layout_constrainedWidth="true"
|
||||
app:layout_constraintBottom_toTopOf="@+id/statusLayout"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
android:background="@drawable/msg_in_top"
|
||||
android:elevation="@dimen/message_bubble_elevation"
|
||||
android:textColorLink="@color/briar_text_link"
|
||||
android:autoLink="web"
|
||||
tools:text="Short message"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
android:elevation="@dimen/message_bubble_elevation"
|
||||
android:textColor="@color/briar_text_primary_inverse"
|
||||
android:textColorLink="@color/briar_text_link_inverse"
|
||||
android:autoLink="web"
|
||||
tools:text="This is a long long long message that spans over several lines.\n\nIt ends here."
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
android:elevation="@dimen/message_bubble_elevation"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textColorLink="@color/briar_text_link"
|
||||
android:autoLink="web"
|
||||
tools:text="Short message"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@
|
||||
android:textIsSelectable="true"
|
||||
android:textSize="@dimen/text_size_medium"
|
||||
android:textColorLink="@color/briar_text_link"
|
||||
android:autoLink="web"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
Reference in New Issue
Block a user