Messaging: allow selecting text inside the selected message am: 78ecab8743 am: 476671be4a am: 1abe606ee5 am: db5364911f
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Messaging/+/1754232 Change-Id: I98e77b40dfe6b3d88af831a2ca9b1dfa6d7c980e
This commit is contained in:
@@ -708,6 +708,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
textBottomPadding = textBottomPaddingDefault;
|
||||
textLeftPadding = messageTextLeftRightPadding;
|
||||
textRightPadding = messageTextLeftRightPadding;
|
||||
mMessageTextView.setTextIsSelectable(isSelected());
|
||||
} else {
|
||||
// Attachment(s) only
|
||||
contentLeftPadding = incoming ? arrowWidth : 0;
|
||||
@@ -733,6 +734,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
textTopMargin = 0;
|
||||
textTopPadding = textTopPaddingDefault;
|
||||
textBottomPadding = textBottomPaddingDefault;
|
||||
mMessageTextView.setTextIsSelectable(isSelected());
|
||||
if (showArrow && incoming) {
|
||||
textLeftPadding = messageTextLeftRightPadding + arrowWidth;
|
||||
} else {
|
||||
@@ -1030,6 +1032,11 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
@Override
|
||||
public boolean onLongClick(final View view) {
|
||||
if (view == mMessageTextView) {
|
||||
// Avoid trying to reselect the message
|
||||
if (isSelected()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Preemptively handle the long click event on message text so it's not handled by
|
||||
// the link spans.
|
||||
return performLongClick();
|
||||
@@ -1195,7 +1202,7 @@ public class ConversationMessageView extends FrameLayout implements View.OnClick
|
||||
// This touch event is a long click, preemptively handle this touch event so that
|
||||
// the link span won't get a onClicked() callback.
|
||||
mIsLongClick = false;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
|
||||
|
||||
Reference in New Issue
Block a user