fix: movement method for all body text moved into the helper function, removed caption from legacy ThumbnailView

pull/620/head
jubb 3 years ago
parent 2a32d21933
commit 29447d6b59

@ -54,7 +54,6 @@ class LinkPreviewView : LinearLayout {
titleTextView.setTextColor(ResourcesCompat.getColor(resources, textColorID, context.theme)) titleTextView.setTextColor(ResourcesCompat.getColor(resources, textColorID, context.theme))
// Body // Body
val bodyTextView = VisibleMessageContentView.getBodyTextView(context, message) val bodyTextView = VisibleMessageContentView.getBodyTextView(context, message)
bodyTextView.movementMethod = LinkMovementMethod.getInstance()
mainLinkPreviewContainer.addView(bodyTextView) mainLinkPreviewContainer.addView(bodyTextView)
// Corner radii // Corner radii
val cornerRadii = MessageBubbleUtilities.calculateRadii(context, isStartOfMessageCluster, isEndOfMessageCluster, message.isOutgoing) val cornerRadii = MessageBubbleUtilities.calculateRadii(context, isStartOfMessageCluster, isEndOfMessageCluster, message.isOutgoing)

@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.conversation.v2.messages
import android.content.Context import android.content.Context
import android.graphics.Rect import android.graphics.Rect
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.text.method.LinkMovementMethod
import android.text.style.ReplacementSpan import android.text.style.ReplacementSpan
import android.text.style.URLSpan import android.text.style.URLSpan
import android.text.util.Linkify import android.text.util.Linkify
@ -171,6 +172,7 @@ class VisibleMessageContentView : LinearLayout {
body = MentionUtilities.highlightMentions(body, message.isOutgoing, message.threadId, context); body = MentionUtilities.highlightMentions(body, message.isOutgoing, message.threadId, context);
result.text = body result.text = body
result.movementMethod = LinkMovementMethod.getInstance()
return result return result
} }

@ -57,7 +57,6 @@ public class ThumbnailView extends FrameLayout {
private ImageView image; private ImageView image;
private View playOverlay; private View playOverlay;
private View captionIcon;
private View loadIndicator; private View loadIndicator;
private OnClickListener parentClickListener; private OnClickListener parentClickListener;
@ -87,7 +86,6 @@ public class ThumbnailView extends FrameLayout {
this.image = findViewById(R.id.thumbnail_image); this.image = findViewById(R.id.thumbnail_image);
this.playOverlay = findViewById(R.id.play_overlay); this.playOverlay = findViewById(R.id.play_overlay);
this.captionIcon = findViewById(R.id.thumbnail_caption_icon);
this.loadIndicator = findViewById(R.id.thumbnail_load_indicator); this.loadIndicator = findViewById(R.id.thumbnail_load_indicator);
super.setOnClickListener(new ThumbnailClickDispatcher()); super.setOnClickListener(new ThumbnailClickDispatcher());
@ -278,8 +276,6 @@ public class ThumbnailView extends FrameLayout {
this.slide = slide; this.slide = slide;
this.captionIcon.setVisibility(GONE);
dimens[WIDTH] = naturalWidth; dimens[WIDTH] = naturalWidth;
dimens[HEIGHT] = naturalHeight; dimens[HEIGHT] = naturalHeight;
invalidate(); invalidate();

Loading…
Cancel
Save